mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix board title cropped using wrong side
This commit is contained in:
parent
48d2135cf3
commit
0aea699482
@ -52,6 +52,7 @@
|
||||
- Fix viewer can update library [Taiga #13186](https://tree.taiga.io/project/penpot/issue/13186)
|
||||
- Fix remove fill affects different element than selected [Taiga #13128](https://tree.taiga.io/project/penpot/issue/13128)
|
||||
- Fix unable to finish the create account form using keyboard [Taiga #11333](https://tree.taiga.io/project/penpot/issue/11333)
|
||||
- Fix 45 rotated board titles rendered incorrectly [Taiga #13306](https://tree.taiga.io/project/penpot/issue/13306)
|
||||
|
||||
## 2.13.3
|
||||
|
||||
|
||||
@ -71,6 +71,12 @@
|
||||
(> (:x cand) (:x cur)) cand
|
||||
:else cur)))
|
||||
|
||||
(defn title-transform-use-width?
|
||||
[{:keys [rotation] :as shape}]
|
||||
(let [side (mth/ceil (/ (- rotation 45) 90))
|
||||
use-width? (even? side)]
|
||||
use-width?))
|
||||
|
||||
(defn title-transform
|
||||
[{:keys [points] :as shape} zoom grid-edition?]
|
||||
(let [leftmost (->> points (reduce left?))
|
||||
|
||||
@ -129,13 +129,15 @@
|
||||
(fn [_]
|
||||
(on-frame-leave (:id frame))))
|
||||
|
||||
main-instance? (ctk/main-instance? frame)
|
||||
is-variant? (:is-variant-container frame)
|
||||
main-instance? (ctk/main-instance? frame)
|
||||
is-variant? (:is-variant-container frame)
|
||||
|
||||
text-width (* (:width frame) zoom)
|
||||
show-icon? (and (or (:use-for-thumbnail frame) is-grid-edition main-instance? is-variant?)
|
||||
(not (<= text-width 15)))
|
||||
text-pos-x (if show-icon? 15 0)
|
||||
use-width? (vwu/title-transform-use-width? frame)
|
||||
|
||||
text-width (* (if use-width? (:width frame) (:height frame)) zoom)
|
||||
show-icon? (and (or (:use-for-thumbnail frame) is-grid-edition main-instance? is-variant?)
|
||||
(not (<= text-width 15)))
|
||||
text-pos-x (if show-icon? 15 0)
|
||||
|
||||
edition* (mf/use-state false)
|
||||
edition? (deref edition*)
|
||||
@ -178,7 +180,6 @@
|
||||
(when (kbd/enter? event) (accept-edit))
|
||||
(when (kbd/esc? event) (cancel-edit))))]
|
||||
|
||||
|
||||
(when (not (:hidden frame))
|
||||
[:g.frame-title {:id (dm/str "frame-title-" (:id frame))
|
||||
:data-edit-grid is-grid-edition
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user