UNPKG

@saran-ign/video-annotation-tool

Version:

[![npm version](https://img.shields.io/npm/v/@saran-ign/video-annotation-tool.svg)](https://www.npmjs.com/package/@saran-ign/video-annotation-tool) [![npm downloads](https://img.shields.io/npm/dm/@saran-ign/video-annotation-tool.svg)](https://www.npmjs.co

8 lines (7 loc) 1.16 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef } from "react"; import { Rect } from "react-konva"; export const Rectangle = forwardRef(({ properties, scaleX, scaleY, color, draggable, onClick, onDragEnd, onDragStart, onTransformEnd, onTransformStart, onDragMove, dragBoundFunc, currentWidth, currentHeight, onMouseEnter, }, ref) => { var _a; return (_jsx(Rect, { ref: ref, x: properties.x * (currentWidth / properties.screenWidth), y: properties.y * (currentHeight / properties.screenHeight), width: properties.width * (currentWidth / properties.screenWidth), height: properties.height * (currentHeight / properties.screenHeight), shadowBlur: 5, stroke: color, strokeWidth: (properties === null || properties === void 0 ? void 0 : properties.strokeWidth) || 2, opacity: (_a = properties === null || properties === void 0 ? void 0 : properties.opacity) !== null && _a !== void 0 ? _a : 1, draggable: draggable, onClick: onClick, onDragEnd: onDragEnd, onDragStart: onDragStart, onDragMove: onDragMove, onMouseEnter: onMouseEnter, dragBoundFunc: dragBoundFunc, onTransformStart: onTransformStart, onTransformEnd: onTransformEnd })); });