Skip to content

Commit 2fc53fb

Browse files
committed
implemented clipping in PGraphicsAndroid2D, fix #288
1 parent 00d442a commit 2fc53fb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

core/src/processing/a2d/PGraphicsAndroid2D.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,25 @@ public void endShape(int mode) {
512512
}
513513

514514

515+
//////////////////////////////////////////////////////////////
516+
517+
// CLIPPING
518+
519+
520+
@Override
521+
protected void clipImpl(float x1, float y1, float x2, float y2) {
522+
// canvas.save(Canvas.CLIP_SAVE_FLAG);
523+
canvas.clipRect(x1, y1, x2, y2);
524+
}
525+
526+
527+
@Override
528+
public void noClip() {
529+
canvas.clipRect(0, 0, width, height, Region.Op.REPLACE);
530+
// canvas.restore();
531+
}
532+
533+
515534
//////////////////////////////////////////////////////////////
516535

517536
// BEZIER VERTICES

0 commit comments

Comments
 (0)