mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
🐛 Fixes measurements with with scroll
This commit is contained in:
parent
9ee54d6267
commit
a3d8af9a96
1 changed files with 6 additions and 4 deletions
|
@ -148,9 +148,9 @@
|
|||
:else 0)
|
||||
|
||||
offset-y (cond (< rect-y (:y bounds)) (- (:y bounds) rect-y)
|
||||
(> (+ rect-y distance-pill-height) (+ (:y bounds) bounds-height))
|
||||
(- (+ (:y bounds) bounds-height) (+ rect-y distance-pill-height))
|
||||
:else 0)]
|
||||
(> (+ rect-y distance-pill-height) (+ (:y bounds) bounds-height))
|
||||
(- (+ (:y bounds) bounds-height) (+ rect-y distance-pill-height (/ distance-pill-height 2)))
|
||||
:else 0)]
|
||||
[:g.distance-pill
|
||||
[:rect {:x (+ rect-x offset-x)
|
||||
:y (+ rect-y offset-y)
|
||||
|
@ -197,7 +197,9 @@
|
|||
h-lines (->> (calculate-distance-lines (:x1 from) (:x2 from) (:x1 to) (:x2 to))
|
||||
(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]
|
||||
(let [center-x (+ x1 (/ (- x2 x1) 2))
|
||||
|
|
Loading…
Add table
Reference in a new issue