Add move cursor when shape is displaced on viewport.

This commit is contained in:
Andrey Antukh 2017-03-01 19:13:10 +01:00
parent 4dc728378c
commit 99f935863a
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
9 changed files with 50 additions and 18 deletions

View file

@ -7,12 +7,13 @@
(ns uxbox.main.ui.shapes.path
(:require [potok.core :as ptk]
[cuerdas.core :as str :include-macros true]
[uxbox.main.geom :as geom]
[uxbox.main.store :as st]
[uxbox.main.refs :as refs]
[uxbox.main.data.shapes :as uds]
[uxbox.main.ui.shapes.common :as common]
[uxbox.main.ui.shapes.attrs :as attrs]
[uxbox.main.data.shapes :as uds]
[uxbox.main.geom :as geom]
[uxbox.util.data :refer [classnames]]
[uxbox.util.geom.matrix :as gmt]
[uxbox.util.geom.point :as gpt]
[uxbox.util.mixins :as mx :include-macros true]))
@ -69,9 +70,14 @@
shape (cond-> shape
displacement (geom/transform displacement)
resize (geom/transform resize))
moving? (boolean displacement)
pdata (render-path shape)
attrs (merge {:id (str id) :d pdata}
(attrs/extract-style-attrs shape))]
props {:id (str id)
:class (classnames :move-cursor moving?)
:d pdata}
attrs (merge (attrs/extract-style-attrs shape) props)]
(if background?
[:g {}
[:path {:stroke "transparent"