From b5c419512fe652bb73790f039be82eae8560272d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 3 Jun 2024 12:58:25 +0200 Subject: [PATCH] :sparkles: Add locking degrees increment (hold shift) on path edition --- CHANGES.md | 3 ++- frontend/src/app/main/data/workspace/path/edition.cljs | 3 +++ frontend/src/app/main/data/workspace/path/streams.cljs | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 17f333222..32af73453 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,8 @@ ### :heart: Community contributions (Thank you!) ### :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 diff --git a/frontend/src/app/main/data/workspace/path/edition.cljs b/frontend/src/app/main/data/workspace/path/edition.cljs index 164e37acb..9d600bbb4 100644 --- a/frontend/src/app/main/data/workspace/path/edition.cljs +++ b/frontend/src/app/main/data/workspace/path/edition.cljs @@ -114,6 +114,9 @@ (update [_ state] (let [id (st/get-path-id state) 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) modifiers-reducer (partial modify-content-point content delta) diff --git a/frontend/src/app/main/data/workspace/path/streams.cljs b/frontend/src/app/main/data/workspace/path/streams.cljs index 38d0efd50..f860ca586 100644 --- a/frontend/src/app/main/data/workspace/path/streams.cljs +++ b/frontend/src/app/main/data/workspace/path/streams.cljs @@ -101,7 +101,12 @@ (->> ms/mouse-position (rx/map to-pixel-snap) (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] (when (and (some? node) (some? handler) (some? opposite))