Skip to content

Commit d906cad

Browse files
committed
minor style fixes
1 parent e8e36cd commit d906cad

File tree

7 files changed

+36
-25
lines changed

7 files changed

+36
-25
lines changed

src/renderer/element/impl/renderable.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(.setAttributeNS dom-el nil (name k) v)))
2424
(.appendChild svg dom-el)
2525
(set! (.-innerHTML dom-el) (if (empty? content) "\u00a0" content))
26-
(let [bounds (bounds/from-bbox dom-el)]
26+
(let [bounds (bounds/dom-el->bounds dom-el)]
2727
(.remove dom-el)
2828
bounds))))
2929

src/renderer/tool/impl/base/transform.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
(defmethod hierarchy/help [:transform :scale]
6161
[]
6262
[:div "Hold " [:span.shortcut-key "Ctrl"] " to lock proportions, "
63-
[:span.shortcut-key ""] " to scale in place, " [:span.shortcut-key "Alt"] " to also scale children."])
63+
[:span.shortcut-key ""] " to scale in place, "
64+
[:span.shortcut-key "Alt"] " to also scale children."])
6465

6566
(m/=> hovered? [:-> App Element boolean? boolean?])
6667
(defn hovered?

src/renderer/utils/bounds.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
[number? {:title "right"}]
1515
[number? {:title "bottom"}]])
1616

17-
(m/=> from-bbox [:-> DomElement [:maybe Bounds]])
18-
(defn from-bbox
17+
(m/=> dom-el->bounds [:-> DomElement [:maybe Bounds]])
18+
(defn dom-el->bounds
1919
"Experimental way of getting the bounds of unknown or complicated elements
2020
using the getBBox method.
2121
https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox"

src/renderer/utils/drop.cljs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
:position position}]))
6161
(.readAsText reader file)))
6262

63+
(def supported-image-types
64+
#{"image/jpeg"
65+
"image/png"
66+
"image/bmp"
67+
"image/gif"})
68+
6369
(m/=> files! [:-> Vec2D any? nil?])
6470
(defn files!
6571
"https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files"
@@ -70,7 +76,7 @@
7076
(= file-type "image/svg+xml")
7177
(add-svg! file position)
7278

73-
(contains? #{"image/jpeg" "image/png" "image/bmp" "image/gif"} file-type)
79+
(contains? supported-image-types file-type)
7480
(add-image! file position)
7581

7682
:else

src/renderer/utils/error.cljs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535
[:p "Please consider submitting an error report to improve your experience."]
3636

3737
[:button.button.px-2.rounded.w-full.mb-5.border.border-default.hover:bg-transparent
38-
{:on-click #(rf/dispatch [::window.e/open-remote-url (submit-error-url error-message)])}
38+
{:on-click #(rf/dispatch [::window.e/open-remote-url
39+
(submit-error-url error-message)])}
3940
"Submit an error report"]
4041

41-
[:p "You can try to undo your last action in order to recover to a previous working state."]
42+
[:p "You can try to undo your last action in order to recover to a
43+
previous working state."]
4244

4345
[:button.button.px-2.rounded.w-full.mb-5.overlay
4446
{:on-click #(do (rf/dispatch [::history.e/undo])
@@ -51,8 +53,10 @@
5153
{:on-click #(rf/dispatch [::window.e/relaunch])}
5254
"Restart the application"]
5355

54-
[:p "If you keep getting the same error after restarting, try clearing your session and options data and restart.
55-
Please note that by doing so, you will loose any unsaved changes and your local application settings."]
56+
[:p "If you keep getting the same error after restarting,
57+
try clearing your session and options data and restart.
58+
Please note that by doing so, you will loose any unsaved changes
59+
and your local application settings."]
5660

5761
[:button.button.px-2.rounded.w-full.bg-warning
5862
{:on-click #(rf/dispatch [::window.e/clear-local-storage-and-relaunch])}

src/renderer/utils/hiccup.cljs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@
2525
(if (= (:tag (zip/node loc)) :svg)
2626
(zip/node loc)
2727
(recur (zip/next loc))))))
28-

src/renderer/utils/migrations.cljs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626

2727
:always
2828
(-> (update :elements update-keys key->uuid)
29-
(update :elements
30-
update-vals
29+
(update :elements update-vals
3130
#(cond-> %
3231
:always
3332
(-> (update :id key->uuid)
@@ -37,18 +36,20 @@
3736
(update :parent key->uuid)))))))]
3837

3938
[[0 4 4] (fn [document]
40-
(update document :elements update-vals (fn [el]
41-
(update-keys el #(case %
42-
:visible? :visible
43-
:selected? :selected
44-
:locked? :locked
45-
%)))))]
39+
(update document :elements update-vals
40+
(fn [el]
41+
(update-keys el #(case %
42+
:visible? :visible
43+
:selected? :selected
44+
:locked? :locked
45+
%)))))]
4646

4747
[[0 4 5] (fn [document]
48-
(update document :elements update-vals (fn [el]
49-
(cond-> el
50-
(= (:tag el) :brush)
51-
(update-in [:attrs :points] #(str/join " " (flatten %)))
52-
53-
:always
54-
element/normalize-attrs))))]])
48+
(update document :elements update-vals
49+
(fn [el]
50+
(cond-> el
51+
(= (:tag el) :brush)
52+
(update-in [:attrs :points] #(str/join " " (flatten %)))
53+
54+
:always
55+
element/normalize-attrs))))]])

0 commit comments

Comments
 (0)