🚀 draw world

This commit is contained in:
platane
2020-07-18 17:02:35 +02:00
parent e9654e7e66
commit a149bab26a
16 changed files with 472 additions and 13 deletions

View File

@@ -0,0 +1,12 @@
export const pathRoundedRect = (
ctx: CanvasRenderingContext2D,
width: number,
height: number,
borderRadius: number
) => {
ctx.moveTo(borderRadius, 0);
ctx.arcTo(width, 0, width, height, borderRadius);
ctx.arcTo(width, height, 0, height, borderRadius);
ctx.arcTo(0, height, 0, 0, borderRadius);
ctx.arcTo(0, 0, width, 0, borderRadius);
};