MCPcopy Create free account
hub / github.com/Shitanshukumar607/Drawspace / handleEllipseTransformEnd

Function handleEllipseTransformEnd

components/CanvasComponent.tsx:277–296  ·  view source on GitHub ↗
(
    id: string,
    e: KonvaEventObject<Event>
  )

Source from the content-addressed store, hash-verified

275 };
276
277 const handleEllipseTransformEnd = (
278 id: string,
279 e: KonvaEventObject<Event>
280 ) => {
281 const node = e.target as Konva.Ellipse;
282 const scaleX = node.scaleX();
283 const scaleY = node.scaleY();
284 const radiusX = Math.max(node.radiusX() * scaleX, 5);
285 const radiusY = Math.max(node.radiusY() * scaleY, 5);
286
287 node.scaleX(1);
288 node.scaleY(1);
289
290 drawingEllipse.updateEllipse(id, {
291 x: node.x(),
292 y: node.y(),
293 radiusX,
294 radiusY,
295 });
296 };
297
298 const handleArrowDragEnd = (id: string, e: KonvaEventObject<Event>) => {
299 const node = e.target as Konva.Arrow;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected