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

Function handleRectangleTransformEnd

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

Source from the content-addressed store, hash-verified

230 };
231
232 const handleRectangleTransformEnd = (
233 id: string,
234 e: KonvaEventObject<Event>
235 ) => {
236 const node = e.target as Konva.Rect;
237 const scaleX = node.scaleX();
238 const scaleY = node.scaleY();
239 const width = Math.max(node.width() * scaleX, 5);
240 const height = Math.max(node.height() * scaleY, 5);
241
242 node.scaleX(1);
243 node.scaleY(1);
244
245 drawingRectangle.updateRectangle(id, {
246 x: node.x(),
247 y: node.y(),
248 width,
249 height,
250 });
251 };
252
253 const handleLineDragEnd = (id: string, e: KonvaEventObject<Event>) => {
254 const node = e.target as Konva.Line;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected