Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
9 changes: 9 additions & 0 deletions test/unit/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ suite('p5.RendererGL', function() {
assert.deepEqual([g1.width, g1.height], [g2.width, g2.height]);
});

test('Filter graphics layer get resized in 2D mode', function () {
let g1 = myp5.createCanvas(10, 10);
let s = myp5.createShader(vert, frag);
myp5.filter(s);
myp5.resizeCanvas(5, 15);
assert.equal(g1.width, 5);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we only care that the sizes are equal when we want to do a filter, so you might need to call myp5.filter(s) again before this assertion

assert.equal(g1.height, 15);
});

test('create graphics is unaffected after filter', function() {
myp5.createCanvas(5, 5, myp5.WEBGL);
let pg = myp5.createGraphics(5, 5, myp5.WEBGL);
Expand Down