mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 11:01:40 +02:00
🐛 Fixes measurements with with scroll
This commit is contained in:
parent
9ee54d6267
commit
a3d8af9a96
1 changed files with 6 additions and 4 deletions
|
@ -149,7 +149,7 @@
|
||||||
|
|
||||||
offset-y (cond (< rect-y (:y bounds)) (- (:y bounds) rect-y)
|
offset-y (cond (< rect-y (:y bounds)) (- (:y bounds) rect-y)
|
||||||
(> (+ rect-y distance-pill-height) (+ (:y bounds) bounds-height))
|
(> (+ rect-y distance-pill-height) (+ (:y bounds) bounds-height))
|
||||||
(- (+ (:y bounds) bounds-height) (+ rect-y distance-pill-height))
|
(- (+ (:y bounds) bounds-height) (+ rect-y distance-pill-height (/ distance-pill-height 2)))
|
||||||
:else 0)]
|
:else 0)]
|
||||||
[:g.distance-pill
|
[:g.distance-pill
|
||||||
[:rect {:x (+ rect-x offset-x)
|
[:rect {:x (+ rect-x offset-x)
|
||||||
|
@ -197,7 +197,9 @@
|
||||||
h-lines (->> (calculate-distance-lines (:x1 from) (:x2 from) (:x1 to) (:x2 to))
|
h-lines (->> (calculate-distance-lines (:x1 from) (:x2 from) (:x1 to) (:x2 to))
|
||||||
(map (fn [[start end]] [start fixed-y end fixed-y])))
|
(map (fn [[start end]] [start fixed-y end fixed-y])))
|
||||||
|
|
||||||
lines (d/concat [] v-lines h-lines)]
|
lines (d/concat [] v-lines h-lines)
|
||||||
|
|
||||||
|
distance-line-stroke (/ distance-line-stroke zoom)]
|
||||||
|
|
||||||
(for [[x1 y1 x2 y2] lines]
|
(for [[x1 y1 x2 y2] lines]
|
||||||
(let [center-x (+ x1 (/ (- x2 x1) 2))
|
(let [center-x (+ x1 (/ (- x2 x1) 2))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue