aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextnodeengine_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix vertical alignment of images in a text documentLars Knoll2018-11-221-1/+1
| | | | | | | | | | | The vertical alignment was not calculated correctly in all cases, this should fix it by retrieving the height and baseline for the current text line and doing the calculation correctly in all cases. Change-Id: I5bb650ede46dc03d51bf0f64b77dc4ca77d30fd2 Fixes: QTBUG-59310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Igor Bugaev <freedbrt@gmail.com>
* Fix flow text objects in beginning of RTL blockEskil Abrahamsen Blomfeldt2016-11-141-1/+11
| | | | | | | | | | | | | If the block is right-to-left and starts with a text object, it should be aligned to the right edge of the QTextLine instead of the left one. [ChangeLog][QtQuick][Text] Fixed placement of flowing text objects in the start of a right-to-left block. Task-number: QTBUG-43133 Change-Id: Id790e88f3464280f124c38b4260386b84cac8826 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTextNode: Minor cleanupRobin Burchell2016-07-111-6/+13
| | | | | | | Move decorations to QQuickTextNodeEngine, as the only place that uses them. Change-Id: I7d0b2bf8979bf5d7e447beac02c3419da4edb759 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* QQuickTextNodeEngine: Remove unused member.Robin Burchell2015-06-051-2/+0
| | | | | | Change-Id: I467d8e2c690592cdca84ef3c539afe6df908c9af Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix disappearing text in selectionsEskil Abrahamsen Blomfeldt2015-03-241-10/+1
| | | | | | | | | | | | | | | | | | Change 11a595e30615943cd6c63f08cc44cde7861112eb introduced a regression where selected text might disappear randomly because we changed the order the nodes were added to the list. The order is significant in cases where there is overlap, such as for painting selections. Instead of iterating over the hash and thus getting the regular nodes in random order, we make the first node with any given key the primary node, add this to the list immediately, and then just do a look up in the hash for the nodes that should be merged with it. Change-Id: Id2208ab672294aa3dd2bc9741e6c6697c2c66746 Task-number: QTBUG-45133 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* Reduce number of allocations when constructing text nodesEskil Abrahamsen Blomfeldt2015-03-091-0/+29
| | | | | | | | | | | | | | | | | | | | | In cases where you have a huge number of text elements that can be merged, we would do a lot of reallocations (one per node that would be merged into another). As the number of merges grew, this seemed to converge at about 50% of the time spent in updatePaintNode() in the text classes. We can almost eliminate this cost by only doing one realloc per node that will actually end up in the scene graph. This patch does a first pass where it simply bundles together nodes that can be merged. Then it does a second pass where it actually merges the nodes. In this second pass it can easily precount the required size of the arrays and we can limit it to a single realloc. Task-number: QTBUG-37365 Change-Id: I4e44c01cd83df39304cbbce34f3b8f773763e091 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Fix missing glyphs in selectionEskil Abrahamsen Blomfeldt2014-10-091-10/+4
| | | | | | | | | | | | | | | | | Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the new selection algorithm which would occur sometimes when a given run of text spanned several script items. Since we are checking the glyph runs for overlaps in the actual text, we need to report the exact characters spanned by the glyph run. We use the new enabler for this in QGlyphRunPrivate. Added a new test case which is an error case we did not yet cover, which is when there is only a single script item, but several font engines are used to produce it (fallback fonts). Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix selection of text with negative right bearingEskil Abrahamsen Blomfeldt2014-09-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Selecting text with a negative right bearing (like italic text) would cause clipping to occur at the edges of the characters. The algorithm for drawing text and text selection tried to divide the text into two: 1. Selected text, and 2. Unselected text. However, the selected text might be drawn outside the selection rect when it has a negative right bearing. Similarly, unselected text before the selection might overlap with the selection rect when it has a negative right bearing, or unselected text after the selection might overlap if it has a negative left bearing. See added test textinput_italic_selected.qml for an example. To rectify this, we do drawing of selected text like this: 1. Draw all text with unselected color 2. Draw selection rects 3. Draw the following in the selection text color and clipped to the selection rect: A. The selected text B. The unselected text right before the selection C. The unselected text right after the selection To avoid drawing the same text twice for extra boldness, we check if 3B or 3C actually contain 3A, in which case we skip 3A. [ChangeLog][Text] Fixed clipping when selecting text with negative right bearing. Task-number: QTBUG-34233 Change-Id: I3506b3a72a2d963c5f24c5b819bbb92769b9aee1 Reviewed-by: Samuel Nevala <samuel.nevala@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Improve memory usage of QQuickTextNode.Michael Brasser2013-08-061-5/+5
| | | | | | | | | | The typical number of BinaryTreeNodes needed for a text line should be much lower than 256. Task-number: QTBUG-32770 Change-Id: I85aa161eb7cb6e55657213304b7577a0a33f1b67 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Optimize QQuickTextEdit for larger documents.Pierre Rossi2013-03-201-0/+234
The rationale is to not end up re-processing the whole document on each update Since we know where the editing takes place, we can break down the text edit's contents in several text nodes and only re-create the affected text nodes upon editing. This requires ripping out the SelectionEngine helper class from QQuickTextNode so that QQuickTextEdit can tap into its functionality directly. A positive side-effect of this exercise is that it should be much harder to to come across GlyphNodes packing more than 16300 glyphs or so. Task-number: QTBUG-29596 Change-Id: Id29b0709baa43f5b29c44ab02398ba996be3e28a Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>