8199441: Wrong caret position in multiline text components on Windows with a screen resolution higher than 100%

Reviewed-by: prr, jdv
This commit is contained in:
Prasanta Sadhukhan 2018-06-15 23:59:56 +05:30
parent e0fbed3a77
commit ecc70a4e02
2 changed files with 130 additions and 4 deletions

View file

@ -364,8 +364,9 @@ public class WrappedPlainView extends BoxView implements TabExpander {
this, p0);
} else {
p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
tabBase, tabBase + currentWidth,
this, p0, false);
(float)tabBase,
(float)(tabBase + currentWidth),
this, p0, false);
}
SegmentCache.releaseSharedSegment(segment);
return p;
@ -847,8 +848,8 @@ public class WrappedPlainView extends BoxView implements TabExpander {
Segment segment = SegmentCache.getSharedSegment();
loadText(segment, p0, p1);
int n = Utilities.getTabbedTextOffset(segment, metrics,
alloc.x, x,
WrappedPlainView.this, p0);
(float)alloc.x, (float)x,
WrappedPlainView.this, p0, false);
SegmentCache.releaseSharedSegment(segment);
return Math.min(p0 + n, p1 - 1);
}