From b5fc074e359fb83e8ef2f722733350ebb71e9b98 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 22 Mar 2023 11:50:44 +0100 Subject: [PATCH] :bug: Fix horizontal margins drag don't always start from place --- CHANGES.md | 2 ++ frontend/src/app/main/ui/measurements.cljs | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8ad27e579..ef505d3dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,8 @@ - Fix problem when assigning color from palette or assets [Taiga #5050](https://tree.taiga.io/project/penpot/issue/5050) - Fix shortcuts for alignment [Taiga #5030](https://tree.taiga.io/project/penpot/issue/5030) - Fix path options not showing when editing rects or ellipses [Taiga #5053](https://tree.taiga.io/project/penpot/issue/5053) +- Fix tooltips for some alignment options are truncated on design tab [Taiga #5040](https://tree.taiga.io/project/penpot/issue/5040) +- Fix horizontal margins drag don't always start from place [Taiga #5020](https://tree.taiga.io/project/penpot/issue/5020) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/ui/measurements.cljs b/frontend/src/app/main/ui/measurements.cljs index 8d9706a6c..4b868473a 100644 --- a/frontend/src/app/main/ui/measurements.cljs +++ b/frontend/src/app/main/ui/measurements.cljs @@ -307,7 +307,7 @@ on-pointer-down (mf/use-callback - (mf/deps frame-id padding-num) + (mf/deps frame-id rect-data padding-num) (fn [event] (dom/capture-pointer event) (reset! resizing? true) @@ -382,9 +382,9 @@ pill-width (/ flex-display-pill-width zoom) pill-height (/ flex-display-pill-height zoom) hover? #(or hover-all? - (and (or (= % :p1) (= % :p3)) hover-v?) - (and (or (= % :p2) (= % :p4)) hover-h?) - (= @hover %)) + (and (or (= % :p1) (= % :p3)) hover-v?) + (and (or (= % :p2) (= % :p4)) hover-h?) + (= @hover %)) negate {:p1 (if (:flip-y frame) true false) :p2 (if (:flip-x frame) true false) :p3 (if (:flip-y frame) true false) @@ -854,9 +854,9 @@ (mf/defc padding [{:keys [frame zoom alt? shift?]}] (when frame - [:g.measurement-gaps {:pointer-events "none"} - [:g.hover-shapes - [:& padding-rects {:frame frame :zoom zoom :alt? alt? :shift? shift?}]]])) + [:g.measurement-gaps {:pointer-events "none"} + [:g.hover-shapes + [:& padding-rects {:frame frame :zoom zoom :alt? alt? :shift? shift?}]]])) (mf/defc gap [{:keys [frame zoom]}]