File tree Expand file tree Collapse file tree 7 files changed +46
-37
lines changed Expand file tree Collapse file tree 7 files changed +46
-37
lines changed Original file line number Diff line number Diff line change 118
118
{:modify-selection " Τροποποίηση επιλογής"
119
119
:select-element " Επιλογή στοιχείου"
120
120
:select-elements " Επιλογή στοιχείων"
121
+ :delete-selection " Διαγραφή επιλεγμένου"
121
122
:toggle " Εναλλαγή %1" }
122
123
123
124
:renderer.element.views
Original file line number Diff line number Diff line change 116
116
117
117
:renderer.element.events
118
118
{:modify-selection " Modify selection"
119
- :select-element " Select elementssss "
119
+ :select-element " Select element "
120
120
:select-elements " Select elements"
121
+ :delete-selection " Delete selection"
121
122
:toggle " Toggle %1" }
122
123
123
124
:renderer.element.views
Original file line number Diff line number Diff line change 35
35
::toggle-prop
36
36
(fn [db [_ id k]]
37
37
(-> (element.handlers/update-prop db id k not)
38
- (history.handlers/finalize #(t [::toggle ( str " Toggle " ( name k)) ] [(name k)])))))
38
+ (history.handlers/finalize #(t [::toggle " Toggle %1 " ] [(name k)])))))
39
39
40
40
(rf/reg-event-db
41
41
::set-prop
83
83
::delete
84
84
(fn [db]
85
85
(-> (element.handlers/delete db)
86
- (history.handlers/finalize #(t [::select-element " Delete selection" ])))))
86
+ (history.handlers/finalize #(t [::delete-selection " Delete selection" ])))))
87
87
88
88
(rf/reg-event-db
89
89
::deselect-all
Original file line number Diff line number Diff line change 5
5
6
6
(def HistoryState
7
7
[:map {:closed true }
8
- [:explanation string?]
8
+ [:explanation [ :or fn? string?] ]
9
9
[:timestamp number?]
10
10
[:index [:or pos-int? zero?]]
11
11
[:id uuid?]
Original file line number Diff line number Diff line change 82
82
(defn ->snapping-points
83
83
[bbox options]
84
84
(let [[min-x min-y max-x max-y] bbox
85
- [cx cy] (center bbox)]
85
+ [cx cy] (center bbox)
86
+ bounds-corner-txt (t [::bounds-corner " bounds corner" ])
87
+ bounds-center-txt (t [::bounds-center " bounds center" ])
88
+ bounds-midpoints-txt (t [::bounds-midpoint " bounds midpoint" ])]
86
89
(cond-> []
87
90
(:corners options)
88
- (into [(with-meta [min-x min-y] {:label ( t [ :: bounds-corner " bounds corner " ]) })
89
- (with-meta [min-x max-y] {:label ( t [ :: bounds-corner " bounds corner " ]) })
90
- (with-meta [max-x min-y] {:label ( t [ :: bounds-corner " bounds corner " ]) })
91
- (with-meta [max-x max-y] {:label ( t [ :: bounds-corner " bounds corner " ]) })])
91
+ (into [(with-meta [min-x min-y] {:label bounds-corner-txt })
92
+ (with-meta [min-x max-y] {:label bounds-corner-txt })
93
+ (with-meta [max-x min-y] {:label bounds-corner-txt })
94
+ (with-meta [max-x max-y] {:label bounds-corner-txt })])
92
95
93
96
(:centers options)
94
- (into [(with-meta [cx cy] {:label ( t [ :: bounds-center " bounds center " ]) })])
97
+ (into [(with-meta [cx cy] {:label bounds-center-txt })])
95
98
96
99
(:midpoints options)
97
- (into [(with-meta [min-x cy] {:label ( t [ :: bounds-corner " bounds midpoint " ]) })
98
- (with-meta [max-x cy] {:label ( t [ :: bounds-corner " bounds midpoint " ]) })
99
- (with-meta [cx min-y] {:label ( t [ :: bounds-corner " bounds midpoint " ]) })
100
- (with-meta [cx max-y] {:label ( t [ :: bounds-corner " bounds midpoint " ]) })]))))
100
+ (into [(with-meta [min-x cy] {:label bounds-midpoints-txt })
101
+ (with-meta [max-x cy] {:label bounds-midpoints-txt })
102
+ (with-meta [cx min-y] {:label bounds-midpoints-txt })
103
+ (with-meta [cx max-y] {:label bounds-midpoints-txt })]))))
Original file line number Diff line number Diff line change 1
1
(ns utils.attribute-test
2
2
(:require
3
3
[cljs.test :refer-macros [deftest testing are]]
4
- [renderer.utils.attribute :as utils.attribute]))
4
+ [renderer.utils.attribute :as utils.attribute]
5
+ [renderer.utils.i18n :as i18n]))
5
6
6
7
(deftest test-str->seq
7
8
(testing " string to sequence conversion"
34
35
:glyphOrientationHorizontal (utils.attribute/->camel-case :Glyphorientationhorizontal ))))
35
36
36
37
(deftest test-defaults
37
- (testing " default tag attributes"
38
- (are [x y] (= x y)
39
- {:x " "
40
- :y " "
41
- :rx " "
42
- :ry " "
43
- :width " "
44
- :height " "
45
- :fill " "
46
- :stroke " "
47
- :stroke-dasharray " "
48
- :stroke-linejoin " "
49
- :style " "
50
- :stroke-width " "
51
- :opacity " "
52
- :id " "
53
- :class " " } (utils.attribute/defaults :rect ))))
38
+ (with-redefs [i18n/t (fn [& _] " translation" )]
39
+ (testing " default tag attributes"
40
+ (are [x y] (= x y)
41
+ {:x " "
42
+ :y " "
43
+ :rx " "
44
+ :ry " "
45
+ :width " "
46
+ :height " "
47
+ :fill " "
48
+ :stroke " "
49
+ :stroke-dasharray " "
50
+ :stroke-linejoin " "
51
+ :style " "
52
+ :stroke-width " "
53
+ :opacity " "
54
+ :id " "
55
+ :class " " } (utils.attribute/defaults :rect )))))
Original file line number Diff line number Diff line change 1
1
(ns utils.bounds-test
2
2
(:require
3
3
[cljs.test :refer-macros [deftest testing are is]]
4
- [renderer.utils.bounds :as utils.bounds]))
4
+ [renderer.utils.bounds :as utils.bounds]
5
+ [renderer.utils.i18n :as i18n]))
5
6
6
7
(deftest test-union
7
8
(testing " united bounds"
38
39
(is (= (utils.bounds/center [0 0 10 10 ]) [5 5 ]))))
39
40
40
41
(deftest test-->snapping-points
41
- (testing " snapping points of bounds"
42
- (is (= (utils.bounds/->snapping-points [0 0 10 10 ] #{:corners :centers :midpoints })
43
- [[0 0 ] [0 10 ] [10 0 ] [10 10 ] [5 5 ] [0 5 ] [10 5 ] [5 0 ] [5 10 ]]))
42
+ (with-redefs [i18n/t (fn [& _] " translation" )]
43
+ (testing " snapping points of bounds"
44
+ (is (= (utils.bounds/->snapping-points [0 0 10 10 ] #{:corners :centers :midpoints })
45
+ [[0 0 ] [0 10 ] [10 0 ] [10 10 ] [5 5 ] [0 5 ] [10 5 ] [5 0 ] [5 10 ]]))
44
46
45
- (is (= (utils.bounds/->snapping-points [0 0 10 10 ] #{}) []))))
47
+ (is (= (utils.bounds/->snapping-points [0 0 10 10 ] #{}) []) ))))
You can’t perform that action at this time.
0 commit comments