MCPcopy
hub / github.com/processing/p5.js / assertValidCanvasSizes

Function assertValidCanvasSizes

test/unit/core/p5.Graphics.js:25–38  ·  view source on GitHub ↗
(canvas, w, h, density)

Source from the content-addressed store, hash-verified

23 }
24
25 function assertValidCanvasSizes(canvas, w, h, density) {
26 assert.strictEqual(canvas.width, w * density, 'canvas.width');
27 assert.strictEqual(canvas.height, h * density, 'canvas.height');
28 assert.strictEqual(
29 canvas.style.width,
30 '' + w + 'px',
31 'invalid canvas.style.width'
32 );
33 assert.strictEqual(
34 canvas.style.height,
35 '' + h + 'px',
36 'invalid canvas.style.height'
37 );
38 }
39
40 function assertValidPixels(graph, w, h, density) {
41 graph.loadPixels();

Callers 1

p5.Graphics.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected