brave bug

by tfoller

HTML

<canvas width=10 height=10 id="aux"></canvas>

CSS

body {
  background: #333;
}

JavaScript

function test2D() {
	const c = document.getElementById("aux");
  const ctx = c.getContext("2d");

  ctx.beginPath();
  ctx.rect(0, 0, 10, 10);
  ctx.fillStyle = "#102030";
  ctx.fill();

  ctx.beginPath();
  ctx.rect(0, 0, 5, 3);
  ctx.fillStyle = "#100000";
  ctx.fill();
  
  const data = ctx.getImageData(0, 0, 10, 10).data;
  let str = '';
  data.forEach((b,i)=> {str+=parseInt(b)+', '; if((i+1) % 4 == 0) str += '\n';});
  console.log(str);
}

test2D();