Fix TextEdit when vertical alignment != AlignTop
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Wed, 8 Apr 2015 11:09:24 +0000 (13:09 +0200)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Thu, 9 Apr 2015 06:32:08 +0000 (06:32 +0000)
commit067a01bc76b76599aa696d867018c1e060ff30c6
tree26da8e12431d26d74e40f288a5eaf38a9761ec25
parent0f15c9a4171cd7d07cf290cda6a11f93bbf7b866
Fix TextEdit when vertical alignment != AlignTop

When the TextEdit's alignment was either AlignBottom or
AlignVCenter, several things would be broken: First of all
the position of all non-dirty nodes would not be updated,
so if you e.g. added text to the end of the document, it
would overlap with the previously added text.

Also, the frame decorations were always aligned to the top, since
the basePosition was not accounted for in the node for this.

The fix is to translate the root node to the base position instead
of baking this into the position of the text nodes. This also
automatically fixes frame decorations since it's already aligned
to the top of the root node.

[ChangeLog][TextEdit] Fixed issues with using other vertical
alignments than AlignTop.

Change-Id: I11f73eab21a28658a5cbf00292fd519efd0f3e7f
Task-number: QTBUG-45032
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/items/qquicktextedit.cpp
tests/manual/scenegraph_lancelot/data/text/textedit_table.qml [new file with mode: 0644]