Skip to content

Commit

Permalink
Revert "remove DomElement schema"
Browse files Browse the repository at this point in the history
This reverts commit aeca4dd.
  • Loading branch information
sprocketc committed Nov 24, 2024
1 parent aeca4dd commit e9f3b21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer/utils/bounds.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[clojure.core.matrix :as mat]
[malli.core :as m]
[renderer.snap.db :refer [SnapOptions]]
[renderer.utils.dom :refer [DomElement]]
[renderer.utils.math :refer [Vec2D]]))

(def Bounds
Expand All @@ -13,7 +14,7 @@
[number? {:title "right"}]
[number? {:title "bottom"}]])

(m/=> dom-el->bounds [:-> any? [:maybe Bounds]])
(m/=> dom-el->bounds [:-> DomElement [:maybe Bounds]])
(defn dom-el->bounds
"Experimental way of getting the bounds of unknown or complicated elements
using the getBBox method.
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/utils/dom.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
(ns renderer.utils.dom)

(def DomElement
[:fn (fn [x] (instance? js/Element x))])

(defn prevent-default!
[e]
(.preventDefault e))
Expand Down

0 comments on commit e9f3b21

Please sign in to comment.