ea 0.6.21 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ea/svg/ea_emitter/elements.rb +17 -9
- data/lib/ea/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 995544bb338cd3ca1a632cd580c978aeb4e85e59e74cce7d35df5736714e397c
|
|
4
|
+
data.tar.gz: c1039f763b50e27f87bfc94f72fdac4de3f542b4a21e7eeb19caf688563ffe9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbc871ca5c043bc1555fb8940beebe50258bfe901df6b2b2e61a7f572ef103dff9aa757dd9896e555dea8da9bf8f17b5a72e8035caeab044dd9f58d5cd730e33
|
|
7
|
+
data.tar.gz: 28a342b4ed8e0129e52f706982d3aa4d0504496fcb15f439158a5c6b8f39128fb1e3ac1dccc12033b55753876904fd9f7f659c66a8181abf3dd249d517ff0741
|
|
@@ -84,7 +84,7 @@ module Ea
|
|
|
84
84
|
op_lines = (is_classifier && show_operations?) ? Element::OperationRenderer.lines_for(classifier) : []
|
|
85
85
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
86
86
|
tagged_values_for(classifier).size,
|
|
87
|
-
header_lines,
|
|
87
|
+
header_lines, classifier: classifier,
|
|
88
88
|
constraints_count: constraints_for(classifier).size,
|
|
89
89
|
marker_count: marker_lines_for(classifier).size,
|
|
90
90
|
enum_literals_count: enum_row_count_for(classifier))
|
|
@@ -100,7 +100,7 @@ module Ea
|
|
|
100
100
|
attr_lines = []
|
|
101
101
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
102
102
|
tagged_values_for(classifier).size,
|
|
103
|
-
header_lines,
|
|
103
|
+
header_lines, classifier: classifier,
|
|
104
104
|
constraints_count: constraints_for(classifier).size,
|
|
105
105
|
marker_count: marker_lines_for(classifier).size,
|
|
106
106
|
enum_literals_count: enum_row_count_for(classifier))
|
|
@@ -112,7 +112,7 @@ module Ea
|
|
|
112
112
|
op_lines = []
|
|
113
113
|
geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
114
114
|
tagged_values_for(classifier).size,
|
|
115
|
-
header_lines,
|
|
115
|
+
header_lines, classifier: classifier,
|
|
116
116
|
constraints_count: constraints_for(classifier).size,
|
|
117
117
|
marker_count: marker_lines_for(classifier).size,
|
|
118
118
|
enum_literals_count: enum_row_count_for(classifier))
|
|
@@ -145,7 +145,7 @@ module Ea
|
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
def compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
148
|
-
tagged_count, header_lines,
|
|
148
|
+
tagged_count, header_lines, classifier: nil,
|
|
149
149
|
constraints_count: 0, marker_count: 0,
|
|
150
150
|
enum_literals_count: 0)
|
|
151
151
|
CompartmentGeometry.new(bounds: bounds, size: size,
|
|
@@ -156,7 +156,7 @@ module Ea
|
|
|
156
156
|
constraints_count: constraints_count,
|
|
157
157
|
marker_count: marker_count,
|
|
158
158
|
enum_literals_count: enum_literals_count,
|
|
159
|
-
header_top_padding: header_padding_for(header_lines),
|
|
159
|
+
header_top_padding: header_padding_for(header_lines, classifier),
|
|
160
160
|
header_line_offset: theme.compartments.header_line_offset,
|
|
161
161
|
divider_offset: theme.compartments.divider_offset,
|
|
162
162
|
attr_line_offset: theme.compartments.attr_line_offset,
|
|
@@ -164,21 +164,29 @@ module Ea
|
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
# EA seats a stereotype line 3px higher than a bare class name
|
|
167
|
-
# (first baseline +16 vs +19 at 7pt) -
|
|
168
|
-
#
|
|
169
|
-
|
|
167
|
+
# (first baseline +16 vs +19 at 7pt) - and Enumeration /
|
|
168
|
+
# Interface elements seat their stereotype 3px higher still
|
|
169
|
+
# (+13). Corpus-verified by identity-matched elements:
|
|
170
|
+
# Interface +13 x44 vs +16 x17, Enumeration +13 x13 vs +16
|
|
171
|
+
# x3, Class/Object/DataType +16 x515.
|
|
172
|
+
def header_padding_for(header_lines, classifier)
|
|
170
173
|
first = header_lines.first
|
|
171
174
|
return theme.compartments.header_top_padding unless first
|
|
172
175
|
|
|
173
176
|
if first.last == :italic
|
|
174
177
|
6 # ghost-led: EA seats the right-aligned ghost at +13
|
|
175
178
|
elsif first.first.to_s.start_with?("«")
|
|
176
|
-
9
|
|
179
|
+
enumeration_or_interface?(classifier) ? 6 : 9
|
|
177
180
|
else
|
|
178
181
|
theme.compartments.header_top_padding
|
|
179
182
|
end
|
|
180
183
|
end
|
|
181
184
|
|
|
185
|
+
def enumeration_or_interface?(classifier)
|
|
186
|
+
classifier.is_a?(Ea::Model::Enumeration) ||
|
|
187
|
+
classifier.is_a?(Ea::Model::Interface)
|
|
188
|
+
end
|
|
189
|
+
|
|
182
190
|
# A stereotype group header («Property») sits 4px below where
|
|
183
191
|
# plain rows start (divider+18 vs divider+14 at 7pt).
|
|
184
192
|
def attr_first_offset_for(attr_lines)
|
data/lib/ea/version.rb
CHANGED