Skip to content

Commit e8569f1

Browse files
authored
Merge branch 'dev-2.0' into colorBranch
2 parents d98c767 + f78009a commit e8569f1

File tree

7 files changed

+23
-6
lines changed

7 files changed

+23
-6
lines changed

src/data/local_storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function storage(p5, fn){
147147
value = value.toString();
148148
} else if (value instanceof p5.Vector) {
149149
type = 'p5.Vector';
150-
const coord = [value.x, value.y, value.z];
150+
const coord = value.values;
151151
value = coord;
152152
}
153153
value = JSON.stringify(value);

src/math/p5.Vector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ class Vector {
265265
* function setup() {
266266
* let v = createVector(20, 30);
267267
*
268-
* // Prints 'p5.Vector Object : [20, 30, 0]'.
268+
* // Prints 'vector[20, 30, 0]'.
269269
* print(v.toString());
270270
* }
271271
* </code>
272272
* </div>
273273
*/
274274
toString() {
275-
return `[${this._values.join(', ')}]`;
275+
return `vector[${this._values.join(', ')}]`;
276276
}
277277

278278
/**

src/webgl/p5.RendererGL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,8 @@ class RendererGL extends Renderer {
13521352
fbo,
13531353
0,
13541354
0,
1355-
this.width,
1356-
this.height,
1355+
fbo.width,
1356+
fbo.height,
13571357
-target.width / 2,
13581358
-target.height / 2,
13591359
target.width,

test/unit/math/p5.Vector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,7 @@ suite('p5.Vector', function () {
20352035
describe('vector to string', () => {
20362036
it('should return the string version of a vector', () => {
20372037
v = new mockP5.Vector(1, 2, 3, 4);
2038-
expect(v.toString()).toBe('[1, 2, 3, 4]');
2038+
expect(v.toString()).toBe('vector[1, 2, 3, 4]');
20392039
});
20402040
});
20412041

test/unit/visual/cases/webgl.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ visualSuite('WebGL', function() {
5151
screenshot();
5252
});
5353

54+
visualTest('On a framebuffer of a different size from the canvas', function(p5, screenshot) {
55+
p5.createCanvas(50, 50, p5.WEBGL);
56+
const fbo = p5.createFramebuffer({ antialias: true, width: 25, height: 100 });
57+
fbo.begin();
58+
p5.background('blue');
59+
p5.fill('red');
60+
p5.circle(0, 0, 20);
61+
p5.filter(p5.BLUR, 3);
62+
fbo.end();
63+
p5.imageMode(p5.CENTER);
64+
p5.image(fbo, 0, 0);
65+
screenshot();
66+
});
67+
5468
visualTest(
5569
'On a framebuffer sized differently from the main canvas',
5670
function(p5, screenshot) {
1.98 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)