mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 18:48:37 -05:00
✨ Changed transparent for none
This commit is contained in:
parent
a80120278e
commit
641e4080bc
11 changed files with 29 additions and 23 deletions
|
@ -75,7 +75,7 @@
|
||||||
:y y
|
:y y
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:style {:fill "transparent"
|
:style {:fill "none"
|
||||||
:stroke select-color
|
:stroke select-color
|
||||||
:stroke-width selection-rect-width}}]]))
|
:stroke-width selection-rect-width}}]]))
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
:y y
|
:y y
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:style {:fill "transparent"
|
:style {:fill "none"
|
||||||
:stroke hover-color
|
:stroke hover-color
|
||||||
:stroke-width selection-rect-width}}]]))
|
:stroke-width selection-rect-width}}]]))
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
;; we setup the default fill as transparent (instead of black)
|
;; we setup the default fill as transparent (instead of black)
|
||||||
(and (not (contains? shape :svg-attrs))
|
(and (not (contains? shape :svg-attrs))
|
||||||
(not (#{ :svg-raw :group } (:type shape))))
|
(not (#{ :svg-raw :group } (:type shape))))
|
||||||
{:fill "transparent"}
|
{:fill "none"}
|
||||||
|
|
||||||
:else
|
:else
|
||||||
{})
|
{})
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#js {:d pdata}))]
|
#js {:d pdata}))]
|
||||||
(if background?
|
(if background?
|
||||||
[:g
|
[:g
|
||||||
[:path {:stroke "transparent"
|
[:path {:stroke "none"
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
:stroke-width "20px"
|
:stroke-width "20px"
|
||||||
:d pdata}]
|
:d pdata}]
|
||||||
[:& shape-custom-stroke {:shape shape
|
[:& shape-custom-stroke {:shape shape
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
:height height
|
:height height
|
||||||
:transform (or transform "none")
|
:transform (or transform "none")
|
||||||
:style {:stroke color
|
:style {:stroke color
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
:stroke-width "1px"
|
:stroke-width "1px"
|
||||||
:pointer-events "none"}}])
|
:pointer-events "none"}}])
|
||||||
|
|
||||||
|
|
|
@ -86,10 +86,11 @@
|
||||||
:on-mouse-down on-mouse-down
|
:on-mouse-down on-mouse-down
|
||||||
:on-mouse-enter on-enter
|
:on-mouse-enter on-enter
|
||||||
:on-mouse-leave on-leave
|
:on-mouse-leave on-leave
|
||||||
|
:pointer-events (when-not preview? "visible")
|
||||||
:style {:cursor (cond
|
:style {:cursor (cond
|
||||||
(= edit-mode :draw) cur/pen-node
|
(= edit-mode :draw) cur/pen-node
|
||||||
(= edit-mode :move) cur/pointer-node)
|
(= edit-mode :move) cur/pointer-node)
|
||||||
:fill "transparent"}}]]))
|
:fill "none"}}]]))
|
||||||
|
|
||||||
(mf/defc path-handler [{:keys [index prefix point handler zoom selected? hover? edit-mode snap-angle?]}]
|
(mf/defc path-handler [{:keys [index prefix point handler zoom selected? hover? edit-mode snap-angle?]}]
|
||||||
(when (and point handler)
|
(when (and point handler)
|
||||||
|
@ -111,7 +112,7 @@
|
||||||
(= edit-mode :move)
|
(= edit-mode :move)
|
||||||
(st/emit! (drp/start-move-handler index prefix))))]
|
(st/emit! (drp/start-move-handler index prefix))))]
|
||||||
|
|
||||||
[:g.handler {:pointer-events (when (= edit-mode :draw))}
|
[:g.handler {:pointer-events (if (= edit-mode :draw) "none" "visible")}
|
||||||
[:line
|
[:line
|
||||||
{:x1 (:x point)
|
{:x1 (:x point)
|
||||||
:y1 (:y point)
|
:y1 (:y point)
|
||||||
|
@ -147,12 +148,12 @@
|
||||||
:on-mouse-enter on-enter
|
:on-mouse-enter on-enter
|
||||||
:on-mouse-leave on-leave
|
:on-mouse-leave on-leave
|
||||||
:style {:cursor (when (= edit-mode :move) cur/pointer-move)
|
:style {:cursor (when (= edit-mode :move) cur/pointer-move)
|
||||||
:fill "transparent"}}]])))
|
:fill "none"}}]])))
|
||||||
|
|
||||||
(mf/defc path-preview [{:keys [zoom command from]}]
|
(mf/defc path-preview [{:keys [zoom command from]}]
|
||||||
[:g.preview {:style {:pointer-events "none"}}
|
[:g.preview {:style {:pointer-events "none"}}
|
||||||
(when (not= :move-to (:command command))
|
(when (not= :move-to (:command command))
|
||||||
[:path {:style {:fill "transparent"
|
[:path {:style {:fill "none"
|
||||||
:stroke pc/black-color
|
:stroke pc/black-color
|
||||||
:stroke-width (/ 1 zoom)
|
:stroke-width (/ 1 zoom)
|
||||||
:stroke-dasharray (/ 4 zoom)}
|
:stroke-dasharray (/ 4 zoom)}
|
||||||
|
@ -274,6 +275,7 @@
|
||||||
[:g.drag-handler {:pointer-events "none"}
|
[:g.drag-handler {:pointer-events "none"}
|
||||||
[:& path-handler {:point last-p
|
[:& path-handler {:point last-p
|
||||||
:handler drag-handler
|
:handler drag-handler
|
||||||
|
:edit-mode edit-mode
|
||||||
:zoom zoom}]])
|
:zoom zoom}]])
|
||||||
|
|
||||||
(when @hover-point
|
(when @hover-point
|
||||||
|
@ -325,6 +327,7 @@
|
||||||
(when prev-handler
|
(when prev-handler
|
||||||
[:g.prev-handler {:pointer-events "none"}
|
[:g.prev-handler {:pointer-events "none"}
|
||||||
[:& path-handler {:point last-p
|
[:& path-handler {:point last-p
|
||||||
|
:edit-mode edit-mode
|
||||||
:handler prev-handler
|
:handler prev-handler
|
||||||
:zoom zoom}]])
|
:zoom zoom}]])
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,6 @@
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
:style {:stroke "#1FDEA7"
|
:style {:stroke "#1FDEA7"
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
:stroke-width (/ 1 zoom)}}])))
|
:stroke-width (/ 1 zoom)}}])))
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
:opacity color-opacity}
|
:opacity color-opacity}
|
||||||
#js {:stroke color-value
|
#js {:stroke color-value
|
||||||
:strokeOpacity color-opacity
|
:strokeOpacity color-opacity
|
||||||
:fill "transparent"})]
|
:fill "none"})]
|
||||||
[:g.grid
|
[:g.grid
|
||||||
(for [{:keys [x y width height]} (gg/grid-areas frame grid)]
|
(for [{:keys [x y width height]} (gg/grid-areas frame grid)]
|
||||||
(do
|
(do
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
"translate(" (* zoom x) ", " (* zoom y) ")")}]
|
"translate(" (* zoom x) ", " (* zoom y) ")")}]
|
||||||
(when arrow-dir
|
(when arrow-dir
|
||||||
[:path {:stroke "#31EFB8"
|
[:path {:stroke "#31EFB8"
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
:stroke-width 2
|
:stroke-width 2
|
||||||
:d arrow-pdata
|
:d arrow-pdata
|
||||||
:transform (str
|
:transform (str
|
||||||
|
@ -134,14 +134,16 @@
|
||||||
|
|
||||||
(if-not selected?
|
(if-not selected?
|
||||||
[:path {:stroke "#B1B2B5"
|
[:path {:stroke "#B1B2B5"
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
|
:pointer-events "visible"
|
||||||
:stroke-width (/ 2 zoom)
|
:stroke-width (/ 2 zoom)
|
||||||
:d pdata
|
:d pdata
|
||||||
:on-mouse-down #(on-mouse-down % orig-shape selected)}]
|
:on-mouse-down #(on-mouse-down % orig-shape selected)}]
|
||||||
|
|
||||||
[:g {:on-mouse-down #(on-mouse-down % orig-shape selected)}
|
[:g {:on-mouse-down #(on-mouse-down % orig-shape selected)}
|
||||||
[:path {:stroke "#31EFB8"
|
[:path {:stroke "#31EFB8"
|
||||||
:fill "transparent"
|
:fill "none"
|
||||||
|
:pointer-events "visible"
|
||||||
:stroke-width (/ 2 zoom)
|
:stroke-width (/ 2 zoom)
|
||||||
:d pdata}]
|
:d pdata}]
|
||||||
[:& interaction-marker {:x orig-x
|
[:& interaction-marker {:x orig-x
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
:path "path"
|
:path "path"
|
||||||
"rect")
|
"rect")
|
||||||
|
|
||||||
common {:fill "transparent"
|
common {:fill "none"
|
||||||
:stroke color
|
:stroke color
|
||||||
:strokeWidth (/ 1 zoom)
|
:strokeWidth (/ 1 zoom)
|
||||||
:pointerEvents "none"
|
:pointerEvents "none"
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
:on-mouse-down on-move-selected
|
:on-mouse-down on-move-selected
|
||||||
:style {:stroke color
|
:style {:stroke color
|
||||||
:stroke-width (/ selection-rect-width zoom)
|
:stroke-width (/ selection-rect-width zoom)
|
||||||
:fill "transparent"}}])))
|
:fill "none"}}])))
|
||||||
|
|
||||||
(defn- handlers-for-selection [{:keys [x y width height]} {:keys [type]} zoom]
|
(defn- handlers-for-selection [{:keys [x y width height]} {:keys [type]} zoom]
|
||||||
(let [zoom-width (* width zoom)
|
(let [zoom-width (* width zoom)
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
:y y
|
:y y
|
||||||
:width size
|
:width size
|
||||||
:height size
|
:height size
|
||||||
:fill (if (debug? :rotation-handler) "blue" "transparent")
|
:fill (if (debug? :rotation-handler) "blue" "none")
|
||||||
:transform transform
|
:transform transform
|
||||||
:on-mouse-down on-rotate}]))
|
:on-mouse-down on-rotate}]))
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
:width resize-point-circle-radius
|
:width resize-point-circle-radius
|
||||||
:height resize-point-circle-radius
|
:height resize-point-circle-radius
|
||||||
:transform (when rotation (str/fmt "rotate(%s, %s, %s)" rotation cx' cy'))
|
:transform (when rotation (str/fmt "rotate(%s, %s, %s)" rotation cx' cy'))
|
||||||
:style {:fill (if (debug? :resize-handler) "red" "transparent")
|
:style {:fill (if (debug? :resize-handler) "red" "none")
|
||||||
:cursor cursor}
|
:cursor cursor}
|
||||||
:on-mouse-down #(on-resize {:x cx' :y cy'} %)}])
|
:on-mouse-down #(on-resize {:x cx' :y cy'} %)}])
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@
|
||||||
:r (/ resize-point-circle-radius zoom)
|
:r (/ resize-point-circle-radius zoom)
|
||||||
:cx cx'
|
:cx cx'
|
||||||
:cy cy'
|
:cy cy'
|
||||||
:style {:fill (if (debug? :resize-handler) "red" "transparent")
|
:style {:fill (if (debug? :resize-handler) "red" "none")
|
||||||
:cursor cursor}}])
|
:cursor cursor}}])
|
||||||
)]))
|
)]))
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@
|
||||||
:transform (gmt/multiply transform
|
:transform (gmt/multiply transform
|
||||||
(gmt/rotate-matrix angle (gpt/point x y)))
|
(gmt/rotate-matrix angle (gpt/point x y)))
|
||||||
:on-mouse-down #(on-resize res-point %)
|
:on-mouse-down #(on-resize res-point %)
|
||||||
:style {:fill (if (debug? :resize-handler) "yellow" "transparent")
|
:style {:fill (if (debug? :resize-handler) "yellow" "none")
|
||||||
:cursor (if (#{:left :right} position)
|
:cursor (if (#{:left :right} position)
|
||||||
(cur/resize-ew rotation)
|
(cur/resize-ew rotation)
|
||||||
(cur/resize-ns rotation)) }}]))
|
(cur/resize-ns rotation)) }}]))
|
||||||
|
@ -245,7 +245,7 @@
|
||||||
transform (geom/transform-matrix shape {:no-flip true})]
|
transform (geom/transform-matrix shape {:no-flip true})]
|
||||||
|
|
||||||
(when (not (#{:move :rotate} current-transform))
|
(when (not (#{:move :rotate} current-transform))
|
||||||
[:g.controls {:pointer-events (when disable-handlers "none")}
|
[:g.controls {:pointer-events (if disable-handlers "none" "visible")}
|
||||||
|
|
||||||
;; Selection rect
|
;; Selection rect
|
||||||
[:& selection-rect {:rect selrect
|
[:& selection-rect {:rect selrect
|
||||||
|
@ -282,10 +282,11 @@
|
||||||
:transform (geom/transform-matrix shape)
|
:transform (geom/transform-matrix shape)
|
||||||
:width width
|
:width width
|
||||||
:height height
|
:height height
|
||||||
|
:pointer-events "visible"
|
||||||
:style {:stroke color
|
:style {:stroke color
|
||||||
:stroke-width "0.5"
|
:stroke-width "0.5"
|
||||||
:stroke-opacity "1"
|
:stroke-opacity "1"
|
||||||
:fill "transparent"}}]]))
|
:fill "none"}}]]))
|
||||||
|
|
||||||
(mf/defc multiple-selection-handlers
|
(mf/defc multiple-selection-handlers
|
||||||
[{:keys [shapes selected zoom color disable-handlers on-move-selected] :as props}]
|
[{:keys [shapes selected zoom color disable-handlers on-move-selected] :as props}]
|
||||||
|
|
Loading…
Add table
Reference in a new issue