mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 02:28:18 -05:00
💄 Minor cosmetic fixes.
This commit is contained in:
parent
7efee0f0a9
commit
c19b289ac8
5 changed files with 29 additions and 28 deletions
|
@ -1175,7 +1175,7 @@
|
|||
"en" : "Store libraries"
|
||||
}
|
||||
},
|
||||
"workspace.options.canvas_background" : {
|
||||
"workspace.options.canvas-background" : {
|
||||
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/page.cljs:39" ],
|
||||
"translations" : {
|
||||
"en" : "Canvas background"
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
(mf/fnc frame-shape
|
||||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [children (unchecked-get props "children")
|
||||
shape (unchecked-get props "shape")
|
||||
(let [childs (unchecked-get props "childs")
|
||||
shape (unchecked-get props "shape")
|
||||
{:keys [id x y width height]} shape
|
||||
|
||||
props (-> (merge frame-default-props shape)
|
||||
|
@ -36,7 +36,7 @@
|
|||
:height height}))]
|
||||
[:svg {:x x :y y :width width :height height}
|
||||
[:> "rect" props]
|
||||
(for [[i item] (d/enumerate children)]
|
||||
(for [[i item] (d/enumerate childs)]
|
||||
[:& shape-wrapper {:frame shape
|
||||
:shape item
|
||||
:key (:id item)}])])))
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"The main container for a frame in viewer mode"
|
||||
(:require
|
||||
[rumext.alpha :as mf]
|
||||
[uxbox.common.data :as d]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.main.data.viewer :as dv]
|
||||
[uxbox.main.refs :as refs]
|
||||
|
@ -47,7 +48,7 @@
|
|||
{:keys [x y width height]} (:selrect shape)
|
||||
|
||||
childs (unchecked-get props "childs")
|
||||
frame (unchecked-get props "frame")
|
||||
frame (unchecked-get props "frame")
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
|
@ -100,13 +101,12 @@
|
|||
[show-interactions?]
|
||||
(generic-wrapper-factory circle/circle-shape show-interactions?))
|
||||
|
||||
|
||||
(declare shape-container-factory)
|
||||
|
||||
(defn frame-container-factory
|
||||
[objects show-interactions?]
|
||||
(let [shape-container (shape-container-factory objects show-interactions?)
|
||||
frame-wrapper (frame-wrapper shape-container show-interactions?)]
|
||||
frame-wrapper (frame-wrapper shape-container show-interactions?)]
|
||||
(mf/fnc frame-container
|
||||
{::mf/wrap-props false}
|
||||
[props]
|
||||
|
@ -135,11 +135,11 @@
|
|||
|
||||
(defn shape-container-factory
|
||||
[objects show-interactions?]
|
||||
(let [path-wrapper (path-wrapper show-interactions?)
|
||||
text-wrapper (text-wrapper show-interactions?)
|
||||
icon-wrapper (icon-wrapper show-interactions?)
|
||||
rect-wrapper (rect-wrapper show-interactions?)
|
||||
image-wrapper (image-wrapper show-interactions?)
|
||||
(let [path-wrapper (path-wrapper show-interactions?)
|
||||
text-wrapper (text-wrapper show-interactions?)
|
||||
icon-wrapper (icon-wrapper show-interactions?)
|
||||
rect-wrapper (rect-wrapper show-interactions?)
|
||||
image-wrapper (image-wrapper show-interactions?)
|
||||
circle-wrapper (circle-wrapper show-interactions?)]
|
||||
(mf/fnc shape-container
|
||||
{::mf/wrap-props false}
|
||||
|
@ -171,19 +171,20 @@
|
|||
(gpt/negate)
|
||||
(gmt/translate-matrix))
|
||||
|
||||
frame-id (:id frame)
|
||||
modifier-ids (concat [frame-id] (cp/get-children frame-id objects))
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
objects (reduce update-fn objects modifier-ids)
|
||||
frame (assoc-in frame [:modifiers :displacement] modifier)
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
|
||||
width (* (:width frame) zoom)
|
||||
height (* (:height frame) zoom)
|
||||
vbox (str "0 0 " (:width frame 0)
|
||||
" " (:height frame 0))
|
||||
wrapper (mf/use-memo
|
||||
(mf/deps objects)
|
||||
#(frame-container-factory objects show-interactions?))]
|
||||
frame-id (:id frame)
|
||||
modifier-ids (d/concat [frame-id] (cp/get-children frame-id objects))
|
||||
objects (reduce update-fn objects modifier-ids)
|
||||
frame (assoc-in frame [:modifiers :displacement] modifier)
|
||||
|
||||
width (* (:width frame) zoom)
|
||||
height (* (:height frame) zoom)
|
||||
vbox (str "0 0 " (:width frame 0)
|
||||
" " (:height frame 0))
|
||||
wrapper (mf/use-memo
|
||||
(mf/deps objects)
|
||||
#(frame-container-factory objects show-interactions?))]
|
||||
|
||||
[:svg {:view-box vbox
|
||||
:width width
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#(mf/deferred % ts/schedule-on-idle)]
|
||||
::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
(let [shape (unchecked-get props "shape")
|
||||
objects (unchecked-get props "objects")
|
||||
|
||||
selected-iref (mf/use-memo (mf/deps (:id shape))
|
||||
|
@ -82,7 +82,7 @@
|
|||
{:keys [x y width height]} shape
|
||||
|
||||
inv-zoom (/ 1 zoom)
|
||||
children (mapv #(get objects %) (:shapes shape))
|
||||
children (mapv #(get objects %) (:shapes shape))
|
||||
ds-modifier (get-in shape [:modifiers :displacement])
|
||||
|
||||
label-pos (gpt/point x (- y (/ 10 zoom)))
|
||||
|
@ -121,5 +121,5 @@
|
|||
[:*
|
||||
[:& frame-shape
|
||||
{:shape shape
|
||||
:children children}]]])))))
|
||||
:childs children}]]])))))
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
options (mf/deref refs/workspace-page-options)
|
||||
handle-change-color (use-change-color page)]
|
||||
[:div.element-set
|
||||
[:div.element-set-title (t locale "workspace.options.canvas_background")]
|
||||
[:div.element-set-title (t locale "workspace.options.canvas-background")]
|
||||
[:div.element-set-content
|
||||
[:& color-row {:disable-opacity true
|
||||
:value {:value (get options :background "#E8E9EA")
|
||||
|
|
Loading…
Add table
Reference in a new issue