mirror of
https://github.com/penpot/penpot.git
synced 2025-03-18 10:41:29 -05:00
✨ Fix problem with constraints
This commit is contained in:
parent
56efb571be
commit
39041bb63b
5 changed files with 15 additions and 7 deletions
|
@ -151,7 +151,9 @@
|
|||
(let [angl (gpt/angle-with-other before-v after-v)
|
||||
sign (if (mth/close? angl 180) -1 1)
|
||||
length (* sign (gpt/length before-v))]
|
||||
(gpt/subtract after-v (gpt/scale (gpt/unit after-v) length))))
|
||||
(if (mth/almost-zero? length)
|
||||
after-v
|
||||
(gpt/subtract after-v (gpt/scale (gpt/unit after-v) length)))))
|
||||
|
||||
(defn side-vector
|
||||
[axis [c0 c1 _ c3]]
|
||||
|
|
|
@ -78,8 +78,8 @@
|
|||
has-group? (->> selected-shapes (d/seek cph/group-shape?))
|
||||
is-group? (and single? has-group?)]
|
||||
(if is-group?
|
||||
(let [parent-id (:parent-id (first selected-shapes))
|
||||
new-shape-id (uuid/next)
|
||||
(let [new-shape-id (uuid/next)
|
||||
parent-id (:parent-id (first selected-shapes))
|
||||
shapes-ids (:shapes (first selected-shapes))
|
||||
ordered-ids (into (d/ordered-set) shapes-ids)]
|
||||
(rx/of (dwse/select-shapes ordered-ids)
|
||||
|
|
|
@ -300,6 +300,7 @@
|
|||
(assoc :frame-id frame-id)
|
||||
(cts/setup-rect-selrect))]
|
||||
(rx/of (add-shape shape))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Artboard
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -199,6 +199,8 @@
|
|||
(mf/use-effect
|
||||
(mf/deps disable?)
|
||||
(fn []
|
||||
(when (and disable? (not @disable-ref?))
|
||||
(rx/push! updates-str :update))
|
||||
(reset! disable-ref? disable?)))
|
||||
|
||||
(mf/use-effect
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(ns app.main.ui.workspace.sidebar.options.rows.stroke-row
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.main.ui.components.dropdown :refer [dropdown]]
|
||||
[app.main.ui.components.numeric-input :refer [numeric-input]]
|
||||
[app.main.ui.hooks :as h]
|
||||
|
@ -132,9 +133,10 @@
|
|||
:on-close (close-caps-select start-caps-state)}
|
||||
[:ul.dropdown.cap-select-dropdown {:style {:top (:top @start-caps-state)
|
||||
:left (:left @start-caps-state)}}
|
||||
(for [[value label separator] (stroke-cap-names)]
|
||||
(for [[idx [value label separator]] (d/enumerate (stroke-cap-names))]
|
||||
(let [img (value->img value)]
|
||||
[:li {:class (dom/classnames :separator separator)
|
||||
[:li {:key (dm/str "start-cap-" idx)
|
||||
:class (dom/classnames :separator separator)
|
||||
:on-click #(on-stroke-cap-start-change index value)}
|
||||
(when img [:img {:src (value->img value)}])
|
||||
label]))]]
|
||||
|
@ -151,9 +153,10 @@
|
|||
:on-close (close-caps-select end-caps-state)}
|
||||
[:ul.dropdown.cap-select-dropdown {:style {:top (:top @end-caps-state)
|
||||
:left (:left @end-caps-state)}}
|
||||
(for [[value label separator] (stroke-cap-names)]
|
||||
(for [[idx [value label separator]] (d/enumerate (stroke-cap-names))]
|
||||
(let [img (value->img value)]
|
||||
[:li {:class (dom/classnames :separator separator)
|
||||
[:li {:key (dm/str "end-cap-" idx)
|
||||
:class (dom/classnames :separator separator)
|
||||
:on-click #(on-stroke-cap-end-change index value)}
|
||||
(when img [:img {:src (value->img value)}])
|
||||
label]))]]])]))
|
||||
|
|
Loading…
Add table
Reference in a new issue