public void setRawClip(ui.geom.Shape clip) { removeClip(); if (clip == null) { return; } com.codename1.ui.geom.Rectangle bounds = clip.getBounds(); if (bounds.getWidth() <= 0 || bounds.getHeight() <= 0) { layer = graphics.CreateLayer(1f, new Rect( bounds.getX(), bounds.getY(), 1, 1 )); return; } if (clip.isRectangle()) { layer = graphics.CreateLayer(1f, new Rect( bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight() )); return; } layer = graphics.CreateLayer(1f, CanvasGeometry.CreatePath(SilverlightImplementation.instance.cn1ShapeToAndroidPath(clip))); }
internal virtual void setClipShape(ui.geom.Shape clip) { removeClip(); if (clip == null) { return; } com.codename1.ui.geom.Rectangle bounds = clip.getBounds(); if (bounds.getWidth() <= 0 || bounds.getHeight() <= 0) { setClip(bounds); return; } CanvasPathBuilder nativeShape = SilverlightImplementation.instance.cn1ShapeToAndroidPath(clip); layer = graphics.CreateLayer(1f, CanvasGeometry.CreatePath(nativeShape)); }