@WeaklyLinked public CGRect inset(UIEdgeInsets insets) { getOrigin().setX(getOrigin().getX() + insets.getLeft()); getOrigin().setY(getOrigin().getY() + insets.getTop()); getSize().setWidth(getSize().getWidth() - (insets.getLeft() + insets.getRight())); getSize().setHeight(getSize().getHeight() - (insets.getTop() + insets.getBottom())); return this; }
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());
public double getY() { return this.getOrigin().getY(); }
public double getY() { return this.getOrigin().getY(); }
private Touch.Event[] toEvents (NSSet<UITouch> touches, UIEvent event, Touch.Event.Kind kind) { final Touch.Event[] events = new Touch.Event[touches.size()]; int idx = 0; for (UITouch touch : touches) { CGPoint loc = touch.getLocationInView(touch.getView()); // transform the point based on our current scale IPoint xloc = plat.graphics().transformTouch((float)loc.getX(), (float)loc.getY()); // on iOS the memory address of the UITouch object is the unique id int id = (int)touch.getHandle(); events[idx++] = new Touch.Event(0, touch.getTimestamp() * 1000, xloc.x(), xloc.y(), kind, id); } return events; } }
private Event.Impl toPointerEvent(NSSet<UITouch> touches, UIEvent event) { for (UITouch touch : touches) { long handle = touch.getHandle(); // if we have an active touch, we only care about that touch if (_active == 0 || handle == _active) { _active = handle; CGPoint loc = touch.getLocationInView(touch.getView()); // transform the point based on our current scale IPoint xloc = platform.graphics().transformTouch((float)loc.getX(), (float)loc.getY()); return new Event.Impl( new Events.Flags.Impl(), touch.getTimestamp() * 1000, xloc.x(), xloc.y(), true); } } return null; }
private Event.Impl[] toTouchEvents(NSSet<UITouch> touches, UIEvent event) { final Event.Impl[] events = new Event.Impl[touches.size()]; int idx = 0; for (UITouch touch : touches) { CGPoint loc = touch.getLocationInView(touch.getView()); // transform the point based on our current scale IPoint xloc = platform.graphics().transformTouch((float)loc.getX(), (float)loc.getY()); // on iOS the memory address of the UITouch object is the unique id int id = (int)touch.getHandle(); events[idx++] = new Event.Impl( new Events.Flags.Impl(), touch.getTimestamp() * 1000, xloc.x(), xloc.y(), id); } return events; } }
@WeaklyLinked public CGRect inset(UIEdgeInsets insets) { getOrigin().setX(getOrigin().getX() + insets.getLeft()); getOrigin().setY(getOrigin().getY() + insets.getTop()); getSize().setWidth(getSize().getWidth() - (insets.getLeft() + insets.getRight())); getSize().setHeight(getSize().getHeight() - (insets.getTop() + insets.getBottom())); return this; }
@WeaklyLinked public CGRect inset(UIEdgeInsets insets) { getOrigin().setX(getOrigin().getX() + insets.getLeft()); getOrigin().setY(getOrigin().getY() + insets.getTop()); getSize().setWidth(getSize().getWidth() - (insets.getLeft() + insets.getRight())); getSize().setHeight(getSize().getHeight() - (insets.getTop() + insets.getBottom())); return this; }
final CGRect bounds = app.getCachedBounds(); locX = (int)(loc.getX() * app.displayScaleFactor - bounds.getMinX()); locY = (int)(loc.getY() * app.displayScaleFactor - bounds.getMinY());