diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2016-03-18 15:49:58 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2016-04-08 09:44:06 +0000 |
commit | 24914b1acbfc5e45768dd1465b9e3f3e61185829 (patch) | |
tree | 3266c75d3bef19a803ca4fbfcbcfdc03238ad096 /src/gui/text/qfontengineglyphcache.cpp | |
parent | f6eadcd60178b1a16224d557b8945020164eba7d (diff) |
Qt Quick: Fix bug for selections with line wraps and breaks
This fixes yet another bug where the selection spans both line
wraps and explicit line breaks. Offsetting the log clusters by
the text position in 342c909b340cb1bfbb95480fc79dcea21a470c83
was not entirely correct, because in some cases the script
item will refer to a specific part of the string, as indicated
by si.position, while iterator.itemStart is in the context
of the full string.
In this case, the log cluster array pointer we use refers to the
script item's part of the array, i.e. it is already offset by
si.position. Therefore, we must offset the logClusters pointer by the
text position *relative* to the current script item. Previously
we would actually offset by si.position twice in cases where
si.position != 0.
We want the text range to refer to the full string, though,
so it can be compared to other text ranges later. However,
in some cases when we are requesting only part of a script item,
then iterator.itemStart does not correspond to relativeFrom,
so in order for the text range search to work, we must pass in
the text positions we are using [relativeFrom, relativeTo],
though offset by si.position so that it refers to the full
string and not just the part addressed by the script item.
Task-number: QTBUG-51759
Change-Id: Ib69856d6d3bc1dd501db94c9d295623f436d122c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qfontengineglyphcache.cpp')
0 files changed, 0 insertions, 0 deletions