ea 0.6.51 → 0.6.52
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 +9 -21
- data/lib/ea/svg/ea_emitter/elements.rb +1 -1
- data/lib/ea/svg/ea_emitter/font_resolver.rb +4 -12
- 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: 592e737c7721bcd03e989dc13572a79c4e8aa53aa654daad717398edb66377ef
|
|
4
|
+
data.tar.gz: 351a11a714b03d40859c3ad86000eb22efc9edde45d3bb376961fd0f1cbad44d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6cdf30f3261579e60f8d72a48b50adf011d4a2afc6398de8edff40ee2eeb701c4a2f605262714fadd19d6e28d2144df3fb7fa51bb04ce4b9306b04beda16df1
|
|
7
|
+
data.tar.gz: 0d0cb7de7ad76775de6751904ea3de403d8d645ad3c7acfee0d4394237d0d330846927ba8d720cf7dd5293c44c9c46c3c8c9bd604119962c45dc98ffc34423bb
|
|
@@ -112,12 +112,14 @@ module Ea
|
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
# EA stores the element font size in tenths of a point in the
|
|
115
|
-
# objectstyle string
|
|
116
|
-
#
|
|
117
|
-
#
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
115
|
+
# objectstyle string, SHIFTED one point up from what it
|
|
116
|
+
# renders: explicit fontsz 100 renders 9pt (0D31AED1: every
|
|
117
|
+
# element stores 100, all 321 texts publish at 9pt), 70
|
|
118
|
+
# renders 6pt, 140 renders 13pt. 0 means "use default", and
|
|
119
|
+
# 80/90 (8pt / 9pt) are EA's classic defaults the dialogs
|
|
120
|
+
# write back when the user never customized — such elements
|
|
121
|
+
# render at the theme size. Only genuinely custom sizes are
|
|
122
|
+
# surfaced as explicit element fonts.
|
|
121
123
|
USE_DEFAULT_FONTSZ = [0, 80, 90].freeze
|
|
122
124
|
|
|
123
125
|
def font_size_from(style_hash)
|
|
@@ -126,23 +128,9 @@ module Ea
|
|
|
126
128
|
|
|
127
129
|
return nil if raw.to_i.zero?
|
|
128
130
|
|
|
129
|
-
stored = (raw.to_f / 10).round
|
|
130
|
-
return stored - 1 if note_element? && stored > 1
|
|
131
|
-
|
|
132
131
|
return nil if USE_DEFAULT_FONTSZ.include?(raw.to_i)
|
|
133
132
|
|
|
134
|
-
|
|
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"
|
|
133
|
+
(raw.to_f / 10).round - 1
|
|
146
134
|
end
|
|
147
135
|
|
|
148
136
|
def build_connectors(diagram_row)
|
|
@@ -263,7 +263,7 @@ module Ea
|
|
|
263
263
|
first = header_lines.first
|
|
264
264
|
return theme.compartments.header_top_padding unless first
|
|
265
265
|
|
|
266
|
-
if first.last == :italic
|
|
266
|
+
if first.last == :italic || first.last == :italic_tight
|
|
267
267
|
6 # ghost-led: EA seats the right-aligned ghost at +13
|
|
268
268
|
elsif first.first.to_s.start_with?("«")
|
|
269
269
|
enumeration_or_interface?(classifier) ? 6 : 9
|
|
@@ -42,8 +42,11 @@ module Ea
|
|
|
42
42
|
explicit = element&.font_size
|
|
43
43
|
explicit = nil if explicit&.zero?
|
|
44
44
|
return explicit if explicit
|
|
45
|
-
return diagram_default_size if diagram_default_size
|
|
46
45
|
|
|
46
|
+
# An element's own explicit fontsz never re-sizes its
|
|
47
|
+
# neighbours: default elements always render at the theme
|
|
48
|
+
# size (9BA1CE54: one 9pt label + six use-default
|
|
49
|
+
# instances; EA publishes the six at 7pt).
|
|
47
50
|
DEFAULT_ELEMENT_FONT_SIZE
|
|
48
51
|
end
|
|
49
52
|
|
|
@@ -77,13 +80,6 @@ module Ea
|
|
|
77
80
|
most_common(families)
|
|
78
81
|
end
|
|
79
82
|
|
|
80
|
-
def diagram_default_size
|
|
81
|
-
sizes = element_sizes
|
|
82
|
-
return nil if sizes.empty?
|
|
83
|
-
|
|
84
|
-
most_common(sizes)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
83
|
FALLBACK_DEFAULT_FAMILY = "Calibri"
|
|
88
84
|
|
|
89
85
|
def most_common(values)
|
|
@@ -97,10 +93,6 @@ module Ea
|
|
|
97
93
|
(diagram.elements || []).map(&:font_family).compact
|
|
98
94
|
end
|
|
99
95
|
|
|
100
|
-
def element_sizes
|
|
101
|
-
(diagram.elements || []).map(&:font_size).compact.reject(&:zero?)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
96
|
def tally_values(values)
|
|
105
97
|
values.each_with_object(Hash.new(0)) { |v, acc| acc[v] += 1 }
|
|
106
98
|
end
|
data/lib/ea/version.rb
CHANGED