/** * @since Available in iOS 2.0 and later. */ @Bridge(symbol="CGRectGetMinY", optional=true) private static native @MachineSizedFloat double getMinY(@ByVal CGRect rect); /**
final CGRect bounds = app.getCachedBounds(); locX = (int)(loc.getX() * app.displayScaleFactor - bounds.getMinX()); locY = (int)(loc.getY() * app.displayScaleFactor - bounds.getMinY());
final CGRect bounds = app.getCachedBounds(); locX = (int)(loc.getX() * app.displayScaleFactor - bounds.getMinX()); locY = (int)(loc.getY() * app.displayScaleFactor - bounds.getMinY());
/** * @since Available in iOS 2.0 and later. */ @Bridge(symbol="CGRectGetMinY", optional=true) private static native @MachineSizedFloat double getMinY(@ByVal CGRect rect); /**
/** * @since Available in iOS 2.0 and later. */ @Bridge(symbol="CGRectGetMinY", optional=true) private static native @MachineSizedFloat double getMinY(@ByVal CGRect rect); /**
private static Rectangle computeBounds(CTFont font, CGRect bounds) { // the y coordinate of bounds is a little tricky: iOS reports y as the number of pixels to // below the baseline that the text extends (the descent, but precisely for this text, not the // font's "maximum" descent) and the value is negative (due to the inverted coordinate system); // so we have to do some math to recover the desired y value which is the number of pixels // below the top-left of the line bounding box float ascent = (float)font.getAscent(); return new Rectangle((float)bounds.getMinX(), ascent - (float)(bounds.getHeight() + bounds.getMinY()), (float)bounds.getWidth(), (float)bounds.getHeight()); } }
private static Rectangle computeBounds(RoboFont font, CGRect bounds) { // the y coordinate of bounds is a little tricky: iOS reports y as the number of pixels to // below the baseline that the text extends (the descent, but precisely for this text, not the // font's "maximum" descent) and the value is negative (due to the inverted coordinate system); // so we have to do some math to recover the desired y value which is the number of pixels // below the top-left of the line bounding box float ascent = (float)font.ctFont.getAscent(); return new Rectangle((float)bounds.getMinX(), ascent - (float)(bounds.getHeight() + bounds.getMinY()), (float)bounds.getWidth(), (float)bounds.getHeight()); } }
context.moveToPoint(boxRect.getMinX() + radius, boxRect.getMinY()); context.addArc(boxRect.getMaxX() - radius, boxRect.getMinY() + radius, radius, 3 * Math.PI / 2, 0, false); context.addArc(boxRect.getMaxX() - radius, boxRect.getMaxY() - radius, radius, 0, Math.PI / 2, false); context.addArc(boxRect.getMinX() + radius, boxRect.getMaxY() - radius, radius, Math.PI / 2, Math.PI, false); context.addArc(boxRect.getMinX() + radius, boxRect.getMinY() + radius, radius, Math.PI, 3 * Math.PI / 2, false); context.closePath(); context.fillPath();
final CGRect bounds = app.getCachedBounds(); locX = (int)(loc.getX() * app.displayScaleFactor - bounds.getMinX()); locY = (int)(loc.getY() * app.displayScaleFactor - bounds.getMinY());