mirror of
https://github.com/penpot/penpot.git
synced 2025-05-31 03:26:10 +02:00
✨ Add workaround to broken texts exception.
This commit is contained in:
parent
357e779013
commit
0416ce8da6
1 changed files with 8 additions and 4 deletions
|
@ -41,7 +41,8 @@
|
||||||
|
|
||||||
;; --- Text Wrapper for workspace
|
;; --- Text Wrapper for workspace
|
||||||
|
|
||||||
(defn handle-shape-resize [{:keys [id selrect grow-type overflow-text]} new-width new-height]
|
(defn handle-shape-resize
|
||||||
|
[{:keys [id selrect grow-type overflow-text]} new-width new-height]
|
||||||
(let [{shape-width :width shape-height :height} selrect
|
(let [{shape-width :width shape-height :height} selrect
|
||||||
undo-transaction (get-in @st/state [:workspace-undo :transaction])]
|
undo-transaction (get-in @st/state [:workspace-undo :transaction])]
|
||||||
(when (not undo-transaction) (st/emit! dwc/start-undo-transaction))
|
(when (not undo-transaction) (st/emit! dwc/start-undo-transaction))
|
||||||
|
@ -59,11 +60,14 @@
|
||||||
(and (or (not= shape-width new-width)
|
(and (or (not= shape-width new-width)
|
||||||
(not= shape-height new-height))
|
(not= shape-height new-height))
|
||||||
(= grow-type :auto-width))
|
(= grow-type :auto-width))
|
||||||
(st/emit! (dw/update-dimensions [id] :width new-width)
|
(when (and (pos? shape-width)
|
||||||
(dw/update-dimensions [id] :height new-height))
|
(pos? shape-height))
|
||||||
|
(st/emit! (dw/update-dimensions [id] :width new-width)
|
||||||
|
(dw/update-dimensions [id] :height new-height)))
|
||||||
|
|
||||||
(and (not= shape-height new-height) (= grow-type :auto-height))
|
(and (not= shape-height new-height) (= grow-type :auto-height))
|
||||||
(st/emit! (dw/update-dimensions [id] :height new-height))))
|
(when (pos? shape-height)
|
||||||
|
(st/emit! (dw/update-dimensions [id] :height new-height)))))
|
||||||
(when (not undo-transaction) (st/emit! dwc/discard-undo-transaction))))
|
(when (not undo-transaction) (st/emit! dwc/discard-undo-transaction))))
|
||||||
|
|
||||||
(defn resize-observer [{:keys [id selrect grow-type overflow-text] :as shape} root query]
|
(defn resize-observer [{:keys [id selrect grow-type overflow-text] :as shape} root query]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue