Skip to content

Commit c34763a

Browse files
committed
Revert "js-port: reset canvas transform at drain start (#137)"
This reverts commit e273a74.
1 parent c11f60a commit c34763a

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

Ports/JavaScriptPort/src/main/java/com/codename1/impl/html5/HTML5Implementation.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,22 +2296,6 @@ public void setGraphicsLocked(boolean locked) {
22962296
}
22972297
CanvasRenderingContext2D context = (CanvasRenderingContext2D)outputCanvas.getContext("2d");
22982298
context.save();
2299-
// The crop rect and the optional clearRect below are interpreted
2300-
// in whatever transform was active on the canvas when ``save()``
2301-
// ran. ClipShape ops leave the canvas at the shape's transform
2302-
// (e.g. a rotation, when a clipRect runs under a rotateRadians)
2303-
// and a subsequent drain inherits that transform via the
2304-
// outer-most save/restore pair -- so without resetting here, the
2305-
// drain's clip becomes a rotated rectangle and clearRect wipes
2306-
// only a rotated wedge, leaving the form to be painted INSIDE
2307-
// that rotated mask while pixels OUTSIDE the mask are leftover
2308-
// content from the previous drain. Visible symptom in the
2309-
// ``graphics-clip-under-rotation`` screenshot test: the entire
2310-
// form (title bar + cells) appears rotated ~30deg even though
2311-
// the test's own ``rotateRadians(+angle) + rotateRadians(-angle)``
2312-
// pair cancels mathematically. Force the drain's initial clip
2313-
// and clear to run in device-coordinate space.
2314-
context.setTransform(1, 0, 0, 1, 0, 0);
23152299
context.beginPath();
23162300
context.rect(frame.getCropX(), frame.getCropY(), frame.getCropW(), frame.getCropH());
23172301
context.clip();

0 commit comments

Comments
 (0)