@Override // from Transform public void transform (IPoint[] src, int srcOff, Point[] dst, int dstOff, int count) { for (int ii = 0; ii < count; ii++) { transform(src[srcOff++], dst[dstOff++]); } }
@Override // from Transform public void transform (IPoint[] src, int srcOff, Point[] dst, int dstOff, int count) { for (int ii = 0; ii < count; ii++) { transform(src[srcOff++], dst[dstOff++]); } }
/** Returns whether the given rectangle intersects the render target area of this surface. */ public boolean intersects (float x, float y, float w, float h) { tx().transform(intersectionTestPoint.set(x, y), intersectionTestPoint); tx().transform(intersectionTestSize.set(w, h), intersectionTestSize); float ix = intersectionTestPoint.x, iy = intersectionTestPoint.y; float iw = intersectionTestSize.x, ih = intersectionTestSize.y; if (scissorDepth > 0) { Rectangle scissor = scissors.get(scissorDepth - 1); return scissor.intersects((int)ix, (int)iy, (int)iw, (int)ih); } float tw = target.width(), th = target.height(); return (ix + iw > 0) && (ix < tw) && (iy + ih > 0) && (iy < th); }
/** Returns whether the given rectangle intersects the render target area of this surface. */ public boolean intersects (float x, float y, float w, float h) { tx().transform(intersectionTestPoint.set(x, y), intersectionTestPoint); tx().transform(intersectionTestSize.set(w, h), intersectionTestSize); float ix = intersectionTestPoint.x, iy = intersectionTestPoint.y; float iw = intersectionTestSize.x, ih = intersectionTestSize.y; if (scissorDepth > 0) { Rectangle scissor = scissors.get(scissorDepth - 1); return scissor.intersects((int)ix, (int)iy, (int)iw, (int)ih); } float tw = target.width(), th = target.height(); return (ix + iw > 0) && (ix < tw) && (iy + ih > 0) && (iy < th); }
/** * Converts the supplied point from coordinates relative to the specified * child layer to coordinates relative to the specified parent layer. The * results are stored into {@code into}, which is returned for convenience. */ public static Point layerToParent(Layer layer, Layer parent, XY point, Point into) { into.set(point); while (layer != parent) { if (layer == null) { throw new IllegalArgumentException( "Failed to find parent, perhaps you passed parent, layer instead of " + "layer, parent?"); } into.x -= layer.originX(); into.y -= layer.originY(); layer.transform().transform(into, into); layer = layer.parent(); } return into; }