Skip to content

Commit

Permalink
feat: ellipse rendering issue fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
dendrofen committed Jan 10, 2025
1 parent 15cd8a5 commit 6b4fefb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Canvas.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { Group, Image, Layer, Line, Rect, Stage, Text } from "react-konva";
import { Arc, Ellipse, Group, Image, Layer, Line, Rect, Stage, Text } from "react-konva";

const CustomImage = ({ src, ...props }) => {
const [image, setImage] = useState();
Expand Down Expand Up @@ -61,6 +61,18 @@ export default function Canvas() {
draggable
/>

<Ellipse fill="red" radiusX={10} radiusY={10} x={width / 2} y={height / 2} />

<Text
x={width / 3}
y={height / 1.8}
text="Use Arc, instead of Ellipse. Red - Ellipse, Green - Arcs. (see example)"

width={width / 2}
/>
<Arc outerRadius={10} angle={360} x={width / 3} y={height / 2} fill={'green'} strokeEnabled={false} />
<Arc outerRadius={10} angle={360} x={width / 1.5} y={height / 2} fill={'green'} strokeEnabled={false} />

{lines.map((points, key) =>
<Line
key={key}
Expand Down

0 comments on commit 6b4fefb

Please sign in to comment.