Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/webgl/3d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ function primitives3D(p5, fn){
const prevOrder = this.bezierOrder();
this.bezierOrder(2);
this.beginShape();
const addUVs = (x, y) => [x, y, (x - x1)/width, (y - y1)/height];
const addUVs = (x, y) => [x, y, 0, (x - x1)/width, (y - y1)/height];
if (tr !== 0) {
this.vertex(...addUVs(x2 - tr, y1));
this.bezierVertex(...addUVs(x2, y1));
Expand Down
20 changes: 20 additions & 0 deletions test/unit/visual/cases/webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,24 @@ visualSuite('WebGL', function() {
screenshot();
});
});

visualSuite('texture()', () => {
visualTest('on a rect', async (p5, screenshot) => {
p5.createCanvas(50, 50, p5.WEBGL);
const tex = await p5.loadImage('/unit/assets/cat.jpg');
p5.texture(tex);
p5.texture(tex);
p5.rect(-20, -20, 40, 40);
screenshot();
});

visualTest('on a rect with rounded corners', async (p5, screenshot) => {
p5.createCanvas(50, 50, p5.WEBGL);
const tex = await p5.loadImage('/unit/assets/cat.jpg');
p5.texture(tex);
p5.texture(tex);
p5.rect(-20, -20, 40, 40, 10);
screenshot();
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading