0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

Merge pull request #4662 from penpot/superalex-locking-degrees-on-path-edition

 Add locking degrees increment (hold shift) on path edition
This commit is contained in:
Eva Marco 2024-06-04 09:34:54 +02:00 committed by GitHub
commit ee2ee326f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -9,7 +9,8 @@
### :heart: Community contributions (Thank you!) ### :heart: Community contributions (Thank you!)
### :sparkles: New features ### :sparkles: New features
- Improve auth process [Taiga #Change Auth Process](https://tree.taiga.io/project/penpot/us/7094) - Improve auth process [Taiga #7094](https://tree.taiga.io/project/penpot/us/7094)
- Add locking degrees increment (hold shift) on path edition [Taiga #7761](https://tree.taiga.io/project/penpot/issue/7761)
### :bug: Bugs fixed ### :bug: Bugs fixed

View file

@ -114,6 +114,9 @@
(update [_ state] (update [_ state]
(let [id (st/get-path-id state) (let [id (st/get-path-id state)
content (st/get-path state :content) content (st/get-path state :content)
to-point (cond-> to-point
(:shift? to-point) (helpers/position-fixed-angle from-point))
delta (gpt/subtract to-point from-point) delta (gpt/subtract to-point from-point)
modifiers-reducer (partial modify-content-point content delta) modifiers-reducer (partial modify-content-point content delta)

View file

@ -101,7 +101,12 @@
(->> ms/mouse-position (->> ms/mouse-position
(rx/map to-pixel-snap) (rx/map to-pixel-snap)
(rx/with-latest-from (snap-toggled-stream)) (rx/with-latest-from (snap-toggled-stream))
(rx/map check-path-snap)))) (rx/map check-path-snap)
(rx/with-latest-from
(fn [position shift? alt?]
(assoc position :shift? shift? :alt? alt?))
ms/mouse-position-shift
ms/mouse-position-alt))))
(defn get-angle [node handler opposite] (defn get-angle [node handler opposite]
(when (and (some? node) (some? handler) (some? opposite)) (when (and (some? node) (some? handler) (some? opposite))