You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Square.svelte

16 lines
281 B

<svelte:options namespace="svg"/>
<script>
export let cx;
export let cy;
export let size;
export let style;
$: x1 = cx - size / 2;
$: y1 = cy - size / 2;
$: x2 = x1 + size;
$: y2 = y1 + size;
</script>
<polygon points="{x1},{y1} {x2},{y1} {x2},{y2} {x1},{y2}" {style}/>