ea 0.6.31 → 0.6.32
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/sources/qea/diagram_builder.rb +31 -5
- data/lib/ea/svg/ea_emitter/connectors.rb +16 -10
- data/lib/ea/svg/ea_emitter/render_context.rb +13 -1
- 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: 6e23a708761ca82e0a23584e7c5ee557251532481defbd16712c676963ad7fbe
|
|
4
|
+
data.tar.gz: dfaeae3624f35848cf7d801e5fdf9c1bf990fa162514838353b98b282da76e51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8efc865e83d8c43843f276c3307158b90ea6674bdf252f39804c48f8cab7c98c765536f1b382773efe2a4a6fd629f97acb6e35d37fd545cdcd5a70f18b98f387
|
|
7
|
+
data.tar.gz: 9eee4896484462b96f7060de2700e893ab4cd2a76b6d4ee7217e1908d5003767914d4e80a9c06a9cea8723ca609f2bae965b903a86660000d2690d39ca442e92
|
|
@@ -165,8 +165,8 @@ module Ea
|
|
|
165
165
|
target = diagram_object_placement(diagram_row.diagram_id, target_id)
|
|
166
166
|
return nil unless source && target
|
|
167
167
|
|
|
168
|
-
source_bounds =
|
|
169
|
-
target_bounds =
|
|
168
|
+
source_bounds = drawn_bounds_for(source)
|
|
169
|
+
target_bounds = drawn_bounds_for(target)
|
|
170
170
|
waypoints = if source_id == target_id
|
|
171
171
|
self_loop_waypoints(source_bounds)
|
|
172
172
|
else
|
|
@@ -224,8 +224,8 @@ module Ea
|
|
|
224
224
|
target_placement = diagram_object_placement(diagram_row.diagram_id, target_id)
|
|
225
225
|
return nil unless source_placement && target_placement
|
|
226
226
|
|
|
227
|
-
source_bounds =
|
|
228
|
-
target_bounds =
|
|
227
|
+
source_bounds = drawn_bounds_for(source_placement)
|
|
228
|
+
target_bounds = drawn_bounds_for(target_placement)
|
|
229
229
|
waypoints = direct_waypoints(source_bounds, target_bounds)
|
|
230
230
|
Ea::Model::DiagramConnector.new(
|
|
231
231
|
id: IdNormalizer.synthetic("xc", diagram_row.diagram_id, object_id),
|
|
@@ -383,7 +383,33 @@ module Ea
|
|
|
383
383
|
connector.end_object_id)
|
|
384
384
|
return [] unless source && target
|
|
385
385
|
|
|
386
|
-
direct_waypoints(
|
|
386
|
+
direct_waypoints(drawn_bounds_for(source),
|
|
387
|
+
drawn_bounds_for(target))
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# The outline EA clips connector rays against: the DRAWN
|
|
391
|
+
# autosized box, not the stored logical rect. Packages draw
|
|
392
|
+
# narrower than their stored rect (body = autosized tab +
|
|
393
|
+
# 15), so their docks land on the drawn edges (E58034A3:
|
|
394
|
+
# supplier right-edge dock 155 drawn vs 121 stored). All
|
|
395
|
+
# other element kinds draw at the stored rect.
|
|
396
|
+
PACKAGE_BODY_EXTRA = 15
|
|
397
|
+
|
|
398
|
+
def drawn_bounds_for(placement)
|
|
399
|
+
logical = bounds_from_rect(placement)
|
|
400
|
+
obj = database.find_object(placement.ea_object_id.to_i)
|
|
401
|
+
return logical unless obj && obj.object_type == "Package"
|
|
402
|
+
|
|
403
|
+
tab = ::Ea::Svg::EaEmitter::Element::PackageShapeRenderer
|
|
404
|
+
.autosized_tab_width(label: obj.name.to_s,
|
|
405
|
+
stereotype: obj.stereotype.to_s,
|
|
406
|
+
size: 7)
|
|
407
|
+
Ea::Model::Bounds.new(
|
|
408
|
+
x: logical.x,
|
|
409
|
+
y: logical.y,
|
|
410
|
+
width: tab + PACKAGE_BODY_EXTRA,
|
|
411
|
+
height: logical.height
|
|
412
|
+
)
|
|
387
413
|
end
|
|
388
414
|
|
|
389
415
|
# Straight-line waypoints between the two box-outline
|
|
@@ -58,17 +58,23 @@ module Ea
|
|
|
58
58
|
pts = waypoints_for(connector)
|
|
59
59
|
return nil if pts.size < 2
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
# E58034A3, 8CF27BE8).
|
|
61
|
+
# DIRECT (auto-routed straight) connectors: EA writes the
|
|
62
|
+
# segment TARGET-FIRST with a trailing zero-length repeat —
|
|
63
|
+
# "M target L source M target" (B6847577, E58034A3,
|
|
64
|
+
# 8CF27BE8). Same pixels as source-first; only the byte
|
|
65
|
+
# order differs, so reversal lives here at the emitter and
|
|
66
|
+
# the marker anchoring (source = first waypoint) is
|
|
67
|
+
# untouched.
|
|
69
68
|
if pts.size == 2 && direct?(connector)
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
x1, y1 = translate_point(pts.first)
|
|
70
|
+
x2, y2 = translate_point(pts.last)
|
|
71
|
+
d = "M #{Canvas.coord(x2)} #{Canvas.coord(y2)} L #{Canvas.coord(x1)} #{Canvas.coord(y1)} " \
|
|
72
|
+
"M #{Canvas.coord(x2)} #{Canvas.coord(y2)}"
|
|
73
|
+
else
|
|
74
|
+
d = pts.each_with_index.map do |p, idx|
|
|
75
|
+
x, y = translate_point(p)
|
|
76
|
+
"#{idx.zero? ? 'M' : 'L'} #{Canvas.coord(x)} #{Canvas.coord(y)}"
|
|
77
|
+
end.join(" ")
|
|
72
78
|
end
|
|
73
79
|
%(<path d="#{d}" shape-rendering="auto"/>)
|
|
74
80
|
end
|
|
@@ -44,7 +44,19 @@ module Ea
|
|
|
44
44
|
!attr_lines.empty? || !op_lines.empty? ||
|
|
45
45
|
enum_literals.any? || tagged_values.any? ||
|
|
46
46
|
(constraints&.any?) ||
|
|
47
|
-
(!package_content_lines.nil? && !package_content_lines.empty?)
|
|
47
|
+
(!package_content_lines.nil? && !package_content_lines.empty?) ||
|
|
48
|
+
hidden_features_present?
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# EA draws the header divider whenever the element HAS a
|
|
52
|
+
# feature compartment — even one whose rows are all hidden
|
|
53
|
+
# by visibility flags (10E3E08A: CodeList with 3 attributes
|
|
54
|
+
# toggled off still renders the divider over an empty body;
|
|
55
|
+
# only feature-less elements omit it).
|
|
56
|
+
def hidden_features_present?
|
|
57
|
+
return false unless classifier.respond_to?(:properties)
|
|
58
|
+
|
|
59
|
+
classifier.properties.any? || classifier.operations.any?
|
|
48
60
|
end
|
|
49
61
|
end
|
|
50
62
|
end
|
data/lib/ea/version.rb
CHANGED