rect = new Rect(0, 0, (int) bbox.getWidth(), (int) bbox.getHeight(), new TextData(curStr, origin, origBBox, -1)); (int) data.origRect().getWidth(), (int) data.origRect().getHeight()); g.drawRect(strx - data.origin().x, stry - data.origin().y, data.markUsed(); final Rectangle2D origRect = data.origRect(); renderer.draw3DRect(x - (scaleFactor * data.origOriginX()), y - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY())), z, rect.x() + (data.origin().x - data.origOriginX()), renderer.getHeight() - rect.y() - (int) origRect.getHeight() - (data.origin().y - data.origOriginY()), (int) origRect.getWidth(), (int) origRect.getHeight(), scaleFactor);
data.markUsed(); final Rectangle2D origRect = data.origRect(); final float x = inX - (scaleFactor * data.origOriginX()); final float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY())); final int texturex = rect.x() + (data.origin().x - data.origOriginX()); final int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() - (data.origin().y - data.origOriginY()); final int width = (int) origRect.getWidth(); final int height = (int) origRect.getHeight();
stringLocations.remove(((TextData) r.getUserData()).string());
final Rect rect = new Rect(0, 0, (int) bbox.getWidth(), (int) bbox.getHeight(), new TextData(null, origin, origBBox, unicodeID)); packer.add(rect); glyphRectForTextureMapping = rect; (int) data.origRect().getWidth(), (int) data.origRect().getHeight()); g.drawRect(strx - data.origin().x, stry - data.origin().y,
/** Returns the bounding rectangle of the given CharSequence, assuming it was rendered at the origin. The coordinate system of the returned rectangle is Java 2D's, with increasing Y coordinates in the downward direction. The relative coordinate (0, 0) in the returned rectangle corresponds to the baseline of the leftmost character of the rendered string, in similar fashion to the results returned by, for example, {@link java.awt.font.GlyphVector#getVisualBounds}. Most applications will use only the width and height of the returned Rectangle for the purposes of centering or justifying the String. It is not specified which Java 2D bounds ({@link java.awt.font.GlyphVector#getVisualBounds getVisualBounds}, {@link java.awt.font.GlyphVector#getPixelBounds getPixelBounds}, etc.) the returned bounds correspond to, although every effort is made to ensure an accurate bound. */ public Rectangle2D getBounds(final CharSequence str) { // FIXME: this should be more optimized and use the glyph cache final Rect r = stringLocations.get(str); if (r != null) { final TextData data = (TextData) r.getUserData(); // Reconstitute the Java 2D results based on the cached values return new Rectangle2D.Double(-data.origin().x, -data.origin().y, r.w(), r.h()); } // Must return a Rectangle compatible with the layout algorithm -- // must be idempotent return normalize(renderDelegate.getBounds(str, font, getFontRenderContext())); }