< prev index next >
src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java
Print this page
@@ -57,11 +57,15 @@
public float getSpan(GlyphView v, int p0, int p1,
TabExpander e, float x) {
sync(v);
Segment text = v.getText(p0, p1);
int[] justificationData = getJustificationData(v);
- int width = Utilities.getTabbedTextWidth(v, text, metrics, (int) x, e, p0,
+
+ Component comp = v.getContainer();
+ FontMetrics metrics1 = comp.getFontMetrics(comp.getFont());
+
+ float width = Utilities.getTabbedTextWidth(v, text, metrics1, x, e, p0,
justificationData);
SegmentCache.releaseSharedSegment(text);
return width;
}
< prev index next >