Skip to content

Commit 1b03c6b

Browse files
committed
Lock in 1x ratio
1 parent a2426fe commit 1b03c6b

File tree

10 files changed

+8
-10
lines changed

10 files changed

+8
-10
lines changed
Binary file not shown.

test/unit/visual/screenshots/WebGL/setAttribute/on QUADS shape mode/metadata.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Binary file not shown.

test/unit/visual/screenshots/WebGL/setAttribute/on TESS shape mode/metadata.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/unit/visual/screenshots/WebGL/setAttribute/on buildGeometry outputs containing 3D primitives/metadata.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
-677 Bytes
Loading
-867 Bytes
Loading
-563 Bytes
Loading

test/unit/visual/visualTest.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,20 @@ export function visualSuite(
6262
}
6363
suiteFn(name, () => {
6464
let lastPrefix;
65+
let lastDeviceRatio = window.devicePixelRatio;
6566
beforeAll(() => {
6667
lastPrefix = namePrefix;
6768
namePrefix += escapeName(name) + '/';
69+
70+
// Force everything to be 1x
71+
window.devicePixelRatio = 1;
6872
})
6973

7074
callback()
7175

7276
afterAll(() => {
7377
namePrefix = lastPrefix;
78+
window.devicePixelRatio = lastDeviceRatio;
7479
});
7580
});
7681
}
@@ -186,7 +191,9 @@ export function visualTest(
186191

187192
// Generate screenshots
188193
await callback(myp5, () => {
189-
actual.push(myp5.get());
194+
const img = myp5.get();
195+
img.pixelDensity(1);
196+
actual.push(img);
190197
});
191198

192199

0 commit comments

Comments
 (0)