Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/context/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ impl PageRecorder{

pub fn set_matrix(&mut self, matrix:Matrix){
self.matrix = matrix;
if let Some(canvas) = self.current.recording_canvas() {
canvas.set_matrix(&matrix.into());
}
self.restore();
}

pub fn set_clip(&mut self, clip:&Option<Path>){
Expand Down
13 changes: 13 additions & 0 deletions tests/visual/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3041,3 +3041,16 @@ tests['transformed drawimage'] = function (ctx) {
ctx.transform(1.2, 1, 1.8, 1.3, 0, 0)
ctx.drawImage(ctx.canvas, 0, 0)
}

tests['clip path after image data'] = function (ctx) {
ctx.scale(10,10);
const data = ctx.getImageData(0,0,1,1);
ctx.putImageData(data,0,0);

ctx.rect(5,5,10,10);
ctx.clip();

ctx.rect(0,0,15,15);
ctx.fillStyle="black";
ctx.fill();
}