< prev index next >
src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java
Print this page
@@ -362,11 +362,12 @@
p = p0 + Utilities.getBreakLocation(segment, metrics,
tabBase, tabBase + currentWidth,
this, p0);
} else {
p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
- tabBase, tabBase + currentWidth,
+ (float)tabBase,
+ (float)(tabBase + currentWidth),
this, p0, false);
}
SegmentCache.releaseSharedSegment(segment);
return p;
}
@@ -845,12 +846,12 @@
} else {
// Determine the offset into the text
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, true);
SegmentCache.releaseSharedSegment(segment);
return Math.min(p0 + n, p1 - 1);
}
}
}
< prev index next >