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