本文整理汇总了Java中org.robovm.apple.coregraphics.CGRect.getMinX方法的典型用法代码示例。如果您正苦于以下问题:Java CGRect.getMinX方法的具体用法?Java CGRect.getMinX怎么用?Java CGRect.getMinX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.robovm.apple.coregraphics.CGRect
的用法示例。
在下文中一共展示了CGRect.getMinX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeBounds
import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
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());
}
示例2: layoutSubviews
import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
@Override
public void layoutSubviews () {
super.layoutSubviews();
recenterIfNecessary();
// tile content in visible bounds
CGRect visibleBounds = convertRectToView(getBounds(), labelContainerView);
double minimumVisibleX = visibleBounds.getMinX();
double maximumVisibleX = visibleBounds.getMaxX();
tileLabels(minimumVisibleX, maximumVisibleX);
}
示例3: placeNewLabelOnLeft
import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
private double placeNewLabelOnLeft (double leftEdge) {
UILabel label = insertLabel();
visibleLabels.add(0, label); // add leftmost label at the beginning of the array
CGRect frame = label.getFrame();
frame.getOrigin().setX(leftEdge - frame.getSize().getWidth());
frame.getOrigin().setY(labelContainerView.getBounds().getSize().getHeight() - frame.getSize().getHeight());
label.setFrame(frame);
return frame.getMinX();
}