mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
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:
parent
e0fbed3a77
commit
ecc70a4e02
2 changed files with 130 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue