🐛 Fix initial auto-fit of viewport.

This commit is contained in:
Andrey Antukh 2020-06-02 11:54:15 +02:00 committed by Alonso Torres
parent fbd6e395a4
commit bee4e5177c
2 changed files with 51 additions and 23 deletions

View file

@ -398,12 +398,11 @@
"Returns a rect that contains all the shapes and is aware of the
rotation of each shape. Mainly used for multiple selection."
[shapes]
(let [xf-resolve-shape (map :selrect)
shapes (into [] xf-resolve-shape shapes)
minx (transduce (map :x1) min ##Inf shapes)
miny (transduce (map :y1) min ##Inf shapes)
maxx (transduce (map :x2) max ##-Inf shapes)
maxy (transduce (map :y2) max ##-Inf shapes)]
(let [shapes (map :selrect shapes)
minx (transduce (map :x1) min ##Inf shapes)
miny (transduce (map :y1) min ##Inf shapes)
maxx (transduce (map :x2) max ##-Inf shapes)
maxy (transduce (map :y2) max ##-Inf shapes)]
{:x1 minx
:y1 miny
:x2 maxx