Skip to content

Commit

Permalink
another test
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed May 7, 2023
1 parent 2318d27 commit b5a6d55
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/visual/generic_rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,39 @@
height: 300,
});

function bgOverlayRespectingVpt(canvas, callback) {
var rectbg = new fabric.Rect({
width: 300,
height: 300,
top: 0,
left: 0,
fill: 'rgba(255,0,0,0.5)'
});
var rectoverlay = new fabric.Rect({
width: 300,
height: 300,
top: 0,
left: 0,
fill: 'rgba(0,0,255,0.5)'
});
canvas.overlayVpt = true;
canvas.backgroundVpt = true;
canvas.setViewportTransform([0.9,0,0,0.9,150,150]);
canvas.backgroundImage = rectbg;
canvas.overlayImage = rectoverlay;
canvas.renderAll();
callback(canvas.lowerCanvasEl);
}

tests.push({
test: 'bg-overlay and vpts',
code: bgOverlayRespectingVpt,
golden: 'bgOverlayRespectVpt.png',
percentage: 0.04,
width: 300,
height: 300,
});

function gradientStroke(canvas, callback) {
var line = new fabric.Line([10, 10, 200, 200], {
stroke: new fabric.Gradient({
Expand Down
Binary file added test/visual/golden/bgOverlayRespectVpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b5a6d55

Please sign in to comment.