base group
This commit is contained in:
@@ -23,12 +23,7 @@ const LinkShape = ({
|
||||
const shapeRef = useRef<Konva.Text>(null);
|
||||
const fontWeight = useMemo(() => getFontWeight(obj.fontWeight), [obj.fontWeight]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isSelected && shapeRef.current && transformerRef.current) {
|
||||
transformerRef.current.nodes([shapeRef.current]);
|
||||
transformerRef.current.getLayer()?.batchDraw();
|
||||
}
|
||||
}, [isSelected, transformerRef]);
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
|
||||
return (
|
||||
<Text
|
||||
@@ -43,11 +38,11 @@ const LinkShape = ({
|
||||
underline={true}
|
||||
rotation={obj.rotation || 0}
|
||||
draggable={draggable}
|
||||
onClick={() => {
|
||||
onClick={(e) => {
|
||||
// در حالت editor، لینکها قابل کلیک نیستند
|
||||
// این قابلیت در viewer اضافه خواهد شد
|
||||
if (shapeRef.current) {
|
||||
onSelect(obj.id, shapeRef.current);
|
||||
onSelect(obj.id, shapeRef.current, e);
|
||||
}
|
||||
}}
|
||||
onDragEnd={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user