box size text

This commit is contained in:
hamid zarghami
2026-05-03 14:25:27 +03:30
parent 1bad82e680
commit b8f7b63ff1
2 changed files with 103 additions and 21 deletions
+11
View File
@@ -1,4 +1,5 @@
import { type FC, useEffect, useState } from 'react'
import Konva from 'konva'
import { clx } from '@/helpers/utils'
import EditorSidebar from './components/EditorSidebar'
import EditorCanvas from './components/EditorCanvas'
@@ -10,6 +11,16 @@ import { useEditorStore } from './store/editorStore'
const Editor: FC = () => {
const { id } = useParams()
// Konva 10 با legacyTextRendering=false متن را با baseline جدید می‌کشد ولی getWidth/getHeight
// و کادر ترنسفورمر هنوز بر اساس جعبهٔ قدیمی‌اند؛ نتیجه: متن از کادر آبی بیرون می‌زند.
useEffect(() => {
const prev = Konva.legacyTextRendering
Konva.legacyTextRendering = true
return () => {
Konva.legacyTextRendering = prev
}
}, [])
const [isLayersPanelOpen, setIsLayersPanelOpen] = useState(false)
const { loadPages, pages } = useEditorStore()
const { data } = useGetCatalogById(id!)