🐛 Fix two runtime errors when creating shapes from library

This commit is contained in:
Andrés Moya 2020-06-11 14:54:52 +02:00 committed by Andrey Antukh
parent 200983fb7c
commit ff5ec11bac
5 changed files with 20 additions and 15 deletions

View file

@ -194,9 +194,10 @@
(us/assert number? height)
(-> shape
(assoc :width width :height height)
(update :selrect (fn [shape]
(assoc :x2 (+ (:x1 shape) width)
:y2 (+ (:y1 shape) height))))))
(update :selrect (fn [selrect]
(assoc selrect
:x2 (+ (:x1 selrect) width)
:y2 (+ (:y1 selrect) height))))))
;; --- Setup (Initialize)

View file

@ -377,10 +377,10 @@
:height 1
:selrect {:x 0
:x1 0
:x2 0
:x2 1
:y 0
:y1 0
:y2 0
:y2 1
:width 1
:height 1}
:points []