We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e28bc5 commit 7d1d338Copy full SHA for 7d1d338
test/unit/webgl/p5.RendererGL.js
@@ -23,6 +23,24 @@ suite('p5.RendererGL', function() {
23
});
24
25
26
+ suite('noSmooth() canvas position preservation', function() {
27
+ test('should maintain the canvas position after calling noSmooth()', function() {
28
+ myp5.createCanvas(300, 300, myp5.WEBGL);
29
+ let cnv = myp5.canvas;
30
+ cnv.style.position = 'absolute';
31
+ cnv.style.top = '150px';
32
+ cnv.style.left = '50px';
33
+ const originalTop = cnv.style.top;
34
+ const originalLeft = cnv.style.left;
35
+
36
+ // Calling noSmooth()
37
+ myp5.noSmooth();
38
+ assert.equal(cnv.style.top, originalTop);
39
+ assert.equal(cnv.style.left, originalLeft);
40
+ });
41
42
43
44
suite('webglVersion', function() {
45
test('should return WEBGL2 by default', function() {
46
myp5.createCanvas(10, 10, myp5.WEBGL);
0 commit comments