(mode)
| 235 | |
| 236 | test('coplanar strokes match 2D', function() { |
| 237 | const getColors = function(mode) { |
| 238 | myp5.createCanvas(20, 20, mode); |
| 239 | myp5.pixelDensity(1); |
| 240 | myp5.background(255); |
| 241 | myp5.strokeCap(myp5.SQUARE); |
| 242 | myp5.strokeJoin(myp5.MITER); |
| 243 | if (mode === myp5.WEBGL) { |
| 244 | myp5.translate(-myp5.width/2, -myp5.height/2); |
| 245 | } |
| 246 | myp5.stroke('black'); |
| 247 | myp5.strokeWeight(4); |
| 248 | myp5.fill('red'); |
| 249 | myp5.rect(10, 10, 15, 15); |
| 250 | myp5.fill('blue'); |
| 251 | myp5.rect(0, 0, 15, 15); |
| 252 | myp5.loadPixels(); |
| 253 | return [...myp5.pixels]; |
| 254 | }; |
| 255 | |
| 256 | const getPixel = (colors, x, y) => { |
| 257 | const idx = (y * 20 + x) * 4; |
no test coverage detected