ea 0.6.114 → 0.6.115
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/config/themes/119.yml +1 -1
- data/lib/ea/sources/qea/diagram_builder.rb +13 -0
- data/lib/ea/svg/ea_emitter/connector_redock.rb +23 -7
- data/lib/ea/svg/ea_emitter/element/legend_renderer.rb +5 -1
- data/lib/ea/svg/ea_emitter/elements.rb +4 -2
- 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: c4e23583eed4c1a582614c26b2c77ada31ab41af83b00b474fcdc199d807b599
|
|
4
|
+
data.tar.gz: 7c02275d511da08c73e261f53815f8d55092420a7bff501151c5b713162068d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 378bb61902c1103887fcc9807e675fd2ebfc2dfe50c7b5266c20f2570b02a42ed0c8b120fc81ca626a6b4d9a421f45d2fd151c21b189714282a50f668ce07b79
|
|
7
|
+
data.tar.gz: 3e4edfe09c4c9235c39e47b6cd202f64bed7904d2b99567cabbff418ecbb7298a1e38b7a0c805fe2e12d760b7e2c11274cf67ee36811925dad804c9c24e61670
|
data/config/themes/119.yml
CHANGED
|
@@ -144,10 +144,23 @@ module Ea
|
|
|
144
144
|
font_italic: truthy?(style_hash[:italic]),
|
|
145
145
|
font_underline: truthy?(style_hash[:ul]),
|
|
146
146
|
show_tagged_values: truthy?(style_hash[:tag]),
|
|
147
|
+
line_width: effective_line_width(obj_row, style_hash),
|
|
147
148
|
background_color: style_hash[:bcol]&.to_i
|
|
148
149
|
)
|
|
149
150
|
end
|
|
150
151
|
|
|
152
|
+
# Negative widths inherit the saved object border, then the diagram theme.
|
|
153
|
+
def effective_line_width(obj_row, style)
|
|
154
|
+
object = database.find_object(obj_row.ea_object_id)
|
|
155
|
+
[style[:lwth], object&.borderwidth].each do |raw|
|
|
156
|
+
next if raw.nil? || raw.to_s.empty?
|
|
157
|
+
|
|
158
|
+
width = raw.to_i
|
|
159
|
+
return width if width >= 0
|
|
160
|
+
end
|
|
161
|
+
nil
|
|
162
|
+
end
|
|
163
|
+
|
|
151
164
|
def truthy?(raw)
|
|
152
165
|
raw == "1" || raw == "-1"
|
|
153
166
|
end
|
|
@@ -215,7 +215,7 @@ module Ea
|
|
|
215
215
|
private_class_method :overlap_ray?
|
|
216
216
|
|
|
217
217
|
# The QEA builder flags a model relationship drawn without any
|
|
218
|
-
# diagram link row;
|
|
218
|
+
# diagram link row; its docks follow the resolved element borders.
|
|
219
219
|
def default_model_connector?(connector)
|
|
220
220
|
connector.style.to_h[:phantom_outline] == true && !connector.has_geometry_offsets &&
|
|
221
221
|
%w[Aggregation Association].include?(connector.connector_type)
|
|
@@ -243,16 +243,32 @@ module Ea
|
|
|
243
243
|
end
|
|
244
244
|
private_class_method :border_width?
|
|
245
245
|
|
|
246
|
-
#
|
|
247
|
-
# absent or inherited widths retain the default outer-stroke docking.
|
|
246
|
+
# EA seats docks on whole pixels; a 1px border keeps the geometric edge.
|
|
248
247
|
def outline_bounds(box, diagram, ref, duid)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
width: box.width + 2, height: box.height + 2)
|
|
248
|
+
inset = (outline_width(diagram, ref, duid) / 2.0).floor
|
|
249
|
+
Ea::Model::Bounds.new(x: box.x - inset, y: box.y - inset,
|
|
250
|
+
width: box.width + 2 * inset, height: box.height + 2 * inset)
|
|
253
251
|
end
|
|
254
252
|
private_class_method :outline_bounds
|
|
255
253
|
|
|
254
|
+
def outline_width(diagram, ref, duid)
|
|
255
|
+
widths = end_placements(diagram, ref, duid).map do |element|
|
|
256
|
+
effective_border_width(element, diagram)
|
|
257
|
+
end.uniq
|
|
258
|
+
widths.size == 1 ? widths.first : diagram.theme.stroke_width
|
|
259
|
+
end
|
|
260
|
+
private_class_method :outline_width
|
|
261
|
+
|
|
262
|
+
def effective_border_width(element, diagram)
|
|
263
|
+
return element.line_width if element.line_width && element.line_width >= 0
|
|
264
|
+
|
|
265
|
+
raw = element.style.to_h[:lwth]
|
|
266
|
+
return raw.to_i if raw && raw.to_i >= 0
|
|
267
|
+
|
|
268
|
+
diagram.theme.stroke_width
|
|
269
|
+
end
|
|
270
|
+
private_class_method :effective_border_width
|
|
271
|
+
|
|
256
272
|
def end_placements(diagram, ref, duid)
|
|
257
273
|
placed = Array(diagram&.elements).select { |el| el.model_element_ref == ref }
|
|
258
274
|
named = placed.select { |el| duid && el.duid.to_s.casecmp?(duid.to_s) }
|
|
@@ -169,7 +169,11 @@ module Ea
|
|
|
169
169
|
end
|
|
170
170
|
|
|
171
171
|
def title_font_size
|
|
172
|
-
|
|
172
|
+
return Ea::Model::Legend::DEFAULT_HEADING_SIZE unless legend.heading_size
|
|
173
|
+
|
|
174
|
+
# HEADINGSIZE is stored in pixels; SVG legend text uses points.
|
|
175
|
+
points = legend.heading_size * 72.0 / 96
|
|
176
|
+
points == points.to_i ? points.to_i : points
|
|
173
177
|
end
|
|
174
178
|
|
|
175
179
|
def item_font_size
|
|
@@ -273,7 +273,7 @@ module Ea
|
|
|
273
273
|
classifier: classifier,
|
|
274
274
|
fill: resolve_fill(element, classifier),
|
|
275
275
|
stroke: resolve_stroke,
|
|
276
|
-
stroke_width: resolve_stroke_width,
|
|
276
|
+
stroke_width: resolve_stroke_width(element),
|
|
277
277
|
text_fill: theme.text_color,
|
|
278
278
|
family: family, size: size, size_unit: size_unit, logical_height: logical_height,
|
|
279
279
|
header_lines: header_lines,
|
|
@@ -670,7 +670,9 @@ module Ea
|
|
|
670
670
|
color_resolver.stroke_for(nil)
|
|
671
671
|
end
|
|
672
672
|
|
|
673
|
-
def resolve_stroke_width
|
|
673
|
+
def resolve_stroke_width(element)
|
|
674
|
+
return element.line_width if element.line_width && element.line_width >= 0
|
|
675
|
+
|
|
674
676
|
theme.themed? ? theme.stroke_width : DEFAULT_STROKE_WIDTH
|
|
675
677
|
end
|
|
676
678
|
|
data/lib/ea/version.rb
CHANGED