ea 0.6.45 → 0.6.46
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c75b8ba9d59e1d04e015a9daacbc50ee2494e41f6a92d3338e204842df32198
|
|
4
|
+
data.tar.gz: 30d44ea4fbac3e6f7566dd9e1a4b353f306faca1190690a8756da6f828f5bb6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86964ae657e21e80eede2a3579ebd0c07070bb4f4d16a7d388e267a4ab883c81969ef08c936c373606b3cc76ee3bce2dcb15b9678306936eefbcd9e822f94330
|
|
7
|
+
data.tar.gz: 0aac4dde65b4fe80813fb8ef1d813b5487159bf0a77160e9ff00e49a70f2490bee5f1c224dae9ccf7ba99337288ecbec3fd7c13bd70d283d6b5f2b78119e5bb5
|
|
@@ -85,6 +85,7 @@ module Ea
|
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def build_element(obj_row, diagram_row)
|
|
88
|
+
@current_obj_row = obj_row
|
|
88
89
|
style_hash = DiagramStyleParser.parse(obj_row.objectstyle)
|
|
89
90
|
Ea::Model::DiagramElement.new(
|
|
90
91
|
id: IdNormalizer.synthetic("de", diagram_row.diagram_id,
|
|
@@ -123,9 +124,25 @@ module Ea
|
|
|
123
124
|
raw = style_hash[:fontsz]
|
|
124
125
|
return nil if raw.nil? || raw.to_s.empty?
|
|
125
126
|
|
|
127
|
+
return nil if raw.to_i.zero?
|
|
128
|
+
|
|
129
|
+
stored = (raw.to_f / 10).round
|
|
130
|
+
return stored - 1 if note_element? && stored > 1
|
|
131
|
+
|
|
126
132
|
return nil if USE_DEFAULT_FONTSZ.include?(raw.to_i)
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
stored
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Text/Note elements carry their real font size in fontsz
|
|
138
|
+
# shifted by one point (stored 100 renders 9pt, 80 renders
|
|
139
|
+
# 7pt - corpus-verified on EA-published note SVGs);
|
|
140
|
+
# classifiers keep the use-default convention.
|
|
141
|
+
def note_element?
|
|
142
|
+
return false unless database && @current_obj_row
|
|
143
|
+
|
|
144
|
+
obj = database.find_object(@current_obj_row.ea_object_id.to_i)
|
|
145
|
+
obj&.object_type.to_s == "Text"
|
|
129
146
|
end
|
|
130
147
|
|
|
131
148
|
def build_connectors(diagram_row)
|
|
@@ -29,11 +29,15 @@ module Ea
|
|
|
29
29
|
usable = context.bounds.width - 15
|
|
30
30
|
size = context.size
|
|
31
31
|
family = context.family
|
|
32
|
+
# EA's note body pitch and first-line offset scale with
|
|
33
|
+
# the note font (9pt notes: pitch 16 = size+7, first line
|
|
34
|
+
# at bounds.y + 18 = size+9 - 9BA1CE54).
|
|
35
|
+
pitch = context.size + 7
|
|
36
|
+
first_offset = context.size + 9
|
|
32
37
|
body.to_s.split(/\n/).flat_map do |para|
|
|
33
|
-
wrap_paragraph(para, usable, size, family)
|
|
38
|
+
wrap_paragraph(para, usable, size, context.family)
|
|
34
39
|
end.each_with_index.map do |line, idx|
|
|
35
|
-
y = context.bounds.y +
|
|
36
|
-
(idx * context.theme.note.line_height)
|
|
40
|
+
y = context.bounds.y + first_offset + (idx * pitch)
|
|
37
41
|
TextRenderer.new(
|
|
38
42
|
content: line,
|
|
39
43
|
x: context.bounds.x + context.theme.note.text_x_offset,
|
|
@@ -19,8 +19,10 @@ module Ea
|
|
|
19
19
|
)
|
|
20
20
|
elsif context.model_element.is_a?(Ea::Model::Package) ||
|
|
21
21
|
context.model_element.is_a?(Ea::Model::Note)
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
# Notes keep the folder silhouette but never render a
|
|
23
|
+
# label (EA publishes note bodies only).
|
|
24
|
+
label = package_label(context.model_element) if context.model_element.is_a?(Ea::Model::Package)
|
|
25
|
+
stereotype = package_stereotype(context.model_element) if context.model_element.is_a?(Ea::Model::Package)
|
|
24
26
|
Element::PackageShapeRenderer.render(
|
|
25
27
|
context.bounds,
|
|
26
28
|
fill: context.fill, stroke: context.stroke,
|
data/lib/ea/version.rb
CHANGED