expo / expo-2d-context

A pure-js implementation of the W3C's Canvas-2D Context API that can be run on either Expo Graphics or WebGL
111 stars 7 forks source link

Expo2DContext.arc with small radius has low polygons #28

Open joonas-yoon opened 2 years ago

joonas-yoon commented 2 years ago

Left one is result on Chrome in pure js, and right one is result with expo-2d-context in React Native.

circles has increasing radius for each line as you can looks like:

image

vanilla javascript

const ctx = canvas.getContext('2d');
ctx.fillStyle = "black";
ctx.fillRect(0, 0, canvas.width, canvas.height);
for (let i = 1; i <= 20; i++) {
  const x = canvas.width / 2;
  const y = canvas.height / 20 * (i - 1);
  ctx.fillStyle = "white";
  ctx.beginPath();
  ctx.arc(x, y, i, 0, 2 * Math.PI);
  ctx.fill();
  ctx.closePath();
}

expo-2d-context https://snack.expo.dev/FrwvgMUBl

Does it mean to have low polygons?