当前位置: 首页>>代码示例>>Java>>正文


Java CGRect.getMinX方法代码示例

本文整理汇总了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());
}
 
开发者ID:playn,项目名称:playn,代码行数:12,代码来源:RoboTextLayout.java

示例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);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:14,代码来源:InfiniteScrollView.java

示例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();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:12,代码来源:InfiniteScrollView.java


注:本文中的org.robovm.apple.coregraphics.CGRect.getMinX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。