box size text
This commit is contained in:
@@ -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!)
|
||||
|
||||
Reference in New Issue
Block a user