mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
🐛 Fix recent colors
This commit is contained in:
parent
ac75d0cc1b
commit
bea96cb586
4 changed files with 6 additions and 1 deletions
|
@ -36,7 +36,9 @@
|
||||||
|
|
||||||
(mf/defc palette
|
(mf/defc palette
|
||||||
[{:keys [current-colors recent-colors file-colors shared-libs selected on-select]}]
|
[{:keys [current-colors recent-colors file-colors shared-libs selected on-select]}]
|
||||||
(let [state (mf/use-state {:show-menu false})
|
(let [;; We had to do this due to a bug that leave some bugged colors
|
||||||
|
current-colors (filter #(some? (:color %)) current-colors)
|
||||||
|
state (mf/use-state {:show-menu false})
|
||||||
|
|
||||||
width (:width @state 0)
|
width (:width @state 0)
|
||||||
visible (/ width 66)
|
visible (/ width 66)
|
||||||
|
|
|
@ -131,6 +131,7 @@
|
||||||
:width canvas-side
|
:width canvas-side
|
||||||
:height canvas-side
|
:height canvas-side
|
||||||
:on-pointer-down handle-start-drag
|
:on-pointer-down handle-start-drag
|
||||||
|
:on-pointer-up handle-stop-drag
|
||||||
:on-lost-pointer-capture handle-stop-drag
|
:on-lost-pointer-capture handle-stop-drag
|
||||||
:on-click calculate-pos
|
:on-click calculate-pos
|
||||||
:on-mouse-move #(when @dragging? (calculate-pos %))}]
|
:on-mouse-move #(when @dragging? (calculate-pos %))}]
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
]
|
]
|
||||||
[:div.value-saturation-selector
|
[:div.value-saturation-selector
|
||||||
{:on-pointer-down handle-start-drag
|
{:on-pointer-down handle-start-drag
|
||||||
|
:on-pointer-up handle-stop-drag
|
||||||
:on-lost-pointer-capture handle-stop-drag
|
:on-lost-pointer-capture handle-stop-drag
|
||||||
:on-click calculate-pos
|
:on-click calculate-pos
|
||||||
:on-mouse-move #(when @dragging? (calculate-pos %))}
|
:on-mouse-move #(when @dragging? (calculate-pos %))}
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
[:div.slider-selector
|
[:div.slider-selector
|
||||||
{:class (str (if vertical? "vertical " "") class)
|
{:class (str (if vertical? "vertical " "") class)
|
||||||
:on-pointer-down handle-start-drag
|
:on-pointer-down handle-start-drag
|
||||||
|
:on-pointer-up handle-stop-drag
|
||||||
:on-lost-pointer-capture handle-stop-drag
|
:on-lost-pointer-capture handle-stop-drag
|
||||||
:on-click calculate-pos
|
:on-click calculate-pos
|
||||||
:on-mouse-move #(when @dragging? (calculate-pos %))}
|
:on-mouse-move #(when @dragging? (calculate-pos %))}
|
||||||
|
|
Loading…
Add table
Reference in a new issue