Skip to content

Commit c6fd362

Browse files
committed
Reduce size of test sketches
From 240x500 to 60x125 px. PNG size from 223 to 12 kB.
1 parent f510d31 commit c6fd362

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

test/unit/visual/cases/shape_modes.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function shapeCorners(p5, shape, mode, x1, y1, x2, y2) {
4343
p5.ellipse(x1, y1, x2, y2);
4444
} else if (shape === 'arc') {
4545
// Draw four arcs with gaps inbetween
46-
const GAP = p5.radians(30);
46+
const GAP = p5.radians(20);
4747
p5.ellipseMode(mode);
4848
p5.arc(x1, y1, x2, y2, 0 + GAP, p5.HALF_PI - GAP);
4949
p5.arc(x1, y1, x2, y2, p5.HALF_PI + GAP, p5.PI - GAP);
@@ -75,7 +75,7 @@ visualSuite('Shape Modes', function(...args) {
7575

7676
for (let mode of MODES) {
7777
visualTest(`Mode ${mode}`, function(p5, screenshot) {
78-
p5.createCanvas(240, 500);
78+
p5.createCanvas(60, 125);
7979
p5.translate(p5.width/2, p5.height/2);
8080

8181
// Make the following calls to shapeCorners shorter
@@ -85,29 +85,29 @@ visualSuite('Shape Modes', function(...args) {
8585
}
8686

8787
// Quadrant I (Bottom Right)
88-
// P1 P2
89-
_shapeCorners( 10, 10, 110, 60); // P1 Top Left, P2 Bottom Right
90-
_shapeCorners( 10, 120, 110, 70); // P1 Bottom Left, P2 Top Right
91-
_shapeCorners(110, 180, 10, 130); // P1 Bottom Right, P2 Top Left
92-
_shapeCorners(110, 190, 10, 240); // P1 Top Right, P2 Bottom Left
88+
// P1 P2
89+
_shapeCorners( 5, 5, 25, 15); // P1 Top Left, P2 Bottom Right
90+
_shapeCorners( 5, 20, 25, 30); // P1 Bottom Left, P2 Top Right
91+
_shapeCorners(25, 45, 5, 35); // P1 Bottom Right, P2 Top Left
92+
_shapeCorners(25, 50, 5, 60); // P1 Top Right, P2 Bottom Left
9393

9494
// Quadrant II (Bottom Left)
95-
_shapeCorners(-110, 10, -10, 60);
96-
_shapeCorners(-110, 120, -10, 70);
97-
_shapeCorners(-10, 180, -110, 130);
98-
_shapeCorners(-10, 190, -110, 240);
95+
_shapeCorners(-25, 5, -5, 15);
96+
_shapeCorners(-25, 20, -5, 30);
97+
_shapeCorners( -5, 45, -25, 35);
98+
_shapeCorners( -5, 50, -25, 60);
9999

100100
// Quadrant III (Top Left)
101-
_shapeCorners(-110, -240, -10, -190);
102-
_shapeCorners(-110, -130, -10, -180);
103-
_shapeCorners(-10, -70, -110, -120);
104-
_shapeCorners(-10, -60, -110, -10);
101+
_shapeCorners(-25, -60, -5, -50);
102+
_shapeCorners(-25, -35, -5, -45);
103+
_shapeCorners( -5, -20, -25, -30);
104+
_shapeCorners( -5, -15, -25, -5);
105105

106106
// Quadrant IV (Top Right)
107-
_shapeCorners( 10, -240, 110, -190);
108-
_shapeCorners( 10, -130, 110, -180);
109-
_shapeCorners(110, -70, 10, -120);
110-
_shapeCorners(110, -60, 10, -10);
107+
_shapeCorners( 5, -60, 25, -50);
108+
_shapeCorners( 5, -35, 25, -45);
109+
_shapeCorners(25, -20, 5, -30);
110+
_shapeCorners(25, -15, 5, -5);
111111

112112
screenshot();
113113
}); // End of: visualTest
-16.4 KB
Loading
-16.4 KB
Loading
-16.4 KB
Loading
-16.4 KB
Loading
-22 KB
Loading
-22 KB
Loading
-22 KB
Loading
-22 KB
Loading
-7.14 KB
Loading

0 commit comments

Comments
 (0)