🎉 Changed the user origin for shapes to their corner

This commit is contained in:
alonso.torres 2020-04-29 09:59:12 +02:00
parent db4e0fc314
commit 7ab3d86bc6
19 changed files with 195 additions and 182 deletions

View file

@ -1,9 +1,7 @@
(ns uxbox.util.debug
"Debugging utils"
(:require
[uxbox.main.store :as store]))
"Debugging utils")
(def debug-options #{:bounding-boxes :group :events :rotation-handler #_:simple-selection })
(def debug-options #{:bounding-boxes :group :events :rotation-handler :selection-center #_:simple-selection })
(defonce ^:dynamic *debug* (atom #{}))
@ -13,6 +11,13 @@
(defn -debug! [option] (swap! *debug* disj option))
(defn debug? [option] (@*debug* option))
(defn ^:export toggle-debug [name] (let [option (keyword name)]
(if (debug? option)
(-debug! option)
(debug! option))))
(defn ^:export debug-all [name] (debug-all!))
(defn tap
"Transducer function that can execute a side-effect `effect-fn` per input"
[effect-fn]
@ -31,9 +36,4 @@
(js/console.log str (clj->js val))
val))
(defn dump-state []
(logjs "state" @store/state))
(defn dump-objects []
(let [page-id (get @store/state :current-page-id)]
(logjs "state" (get-in @store/state [:workspace-data page-id :objects]))))