can edit text + fix font weight - remove character space
This commit is contained in:
@@ -65,33 +65,40 @@ const EditorCanvas = () => {
|
||||
draggable={tool === "select"}
|
||||
/>
|
||||
))}
|
||||
{selectedObjectId && (
|
||||
<Transformer
|
||||
ref={transformerRef}
|
||||
boundBoxFunc={(oldBox, newBox) => {
|
||||
if (Math.abs(newBox.width) < 5 || Math.abs(newBox.height) < 5) {
|
||||
return oldBox;
|
||||
}
|
||||
return newBox;
|
||||
}}
|
||||
anchorFill="#3b82f6"
|
||||
anchorStroke="#ffffff"
|
||||
borderStroke="#3b82f6"
|
||||
borderStrokeWidth={2}
|
||||
anchorSize={8}
|
||||
rotateEnabled={true}
|
||||
enabledAnchors={[
|
||||
"top-left",
|
||||
"top-right",
|
||||
"bottom-left",
|
||||
"bottom-right",
|
||||
"top-center",
|
||||
"bottom-center",
|
||||
"middle-left",
|
||||
"middle-right",
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
{selectedObjectId && (() => {
|
||||
const selectedObject = objects.find(obj => obj.id === selectedObjectId);
|
||||
const isText = selectedObject?.type === "text";
|
||||
|
||||
return (
|
||||
<Transformer
|
||||
ref={transformerRef}
|
||||
boundBoxFunc={(oldBox, newBox) => {
|
||||
if (Math.abs(newBox.width) < 5 || Math.abs(newBox.height) < 5) {
|
||||
return oldBox;
|
||||
}
|
||||
return newBox;
|
||||
}}
|
||||
ignoreStroke={isText}
|
||||
perfectDrawEnabled={false}
|
||||
anchorFill="#3b82f6"
|
||||
anchorStroke="#ffffff"
|
||||
borderStroke="#3b82f6"
|
||||
borderStrokeWidth={2}
|
||||
anchorSize={8}
|
||||
rotateEnabled={true}
|
||||
enabledAnchors={[
|
||||
"top-left",
|
||||
"top-right",
|
||||
"bottom-left",
|
||||
"bottom-right",
|
||||
"top-center",
|
||||
"bottom-center",
|
||||
"middle-left",
|
||||
"middle-right",
|
||||
]}
|
||||
/>
|
||||
);
|
||||
})()}
|
||||
</Layer>
|
||||
</Stage>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user