ea 0.6.51 → 0.6.53

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: 3bac390d3be1320d1679f33e3ed0e83b0982c02faea48f6ebbc2acdc31aa345b
4
- data.tar.gz: c0ffb44d6f3cb775e37edbbe8fc10ddfb10a802c9555846aba5f21188901c3dc
3
+ metadata.gz: '007348c214ad1a2ed4226d46e55a528dafcb12d9e4b5eae9e4d3a3e7d13b5c8c'
4
+ data.tar.gz: 7b6af86fe7a76f8661c993b2559345d1538ef5fda6f4fa912f6925be4e4a79f2
5
5
  SHA512:
6
- metadata.gz: b380504257c1e1b3ad40852561d4535e4a2dd4f6894427715eeb2a192b7ca7b9d43b77bed8d9c6c28bfaacf0d62586f4204fac00d3e6642646f1f3f214f2e0e3
7
- data.tar.gz: 80acb5162983cbe2052c63bbb417adb0a019be316eba63aeb54166680f6c68b4865b2da41378eff7fd9dcc5eab117a46bbc2a577e426451b95bc75a222c556d0
6
+ metadata.gz: 4b75f8f3f76d3c4433f147c7f9afba023c84f7961e5c901465c6d237a8775817d130596b4c75714d0bc367bc7605e5db1b356bc8bff2d23a45b723e77deaadf3
7
+ data.tar.gz: e6d556ef5bdc04dad2fe196d26114672d7f7b0c9c5e580588279697f3ec5c45538d0fd0729a5847716dd01b98acb64a529aa1d19c38363a99fc307168e5554c6
@@ -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. 0 means "use default", and 80/90 (8pt /
116
- # 9pt) are EA's classic defaults the dialogs write back when
117
- # the user never customized — verified against EA-published
118
- # reference images, where such elements render at the theme
119
- # size. Only genuinely custom sizes are surfaced as explicit
120
- # element fonts.
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
- 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"
133
+ (raw.to_f / 10).round - 1
146
134
  end
147
135
 
148
136
  def build_connectors(diagram_row)
@@ -33,6 +33,7 @@ module Ea
33
33
  multiplicity_upper_raw: raw_upper(row),
34
34
  multiplicity_upper: parse_upper(row),
35
35
  default_value: row.default,
36
+ is_derived: boolean(row.derived),
36
37
  is_ordered: boolean(row.isordered),
37
38
  is_unique: !boolean(row.allowduplicates),
38
39
  visibility: visibility_from_scope(row.scope),
@@ -64,6 +64,10 @@ module Ea
64
64
  def namespaced_name
65
65
  prefix = inherited_namespace_prefix
66
66
  base = property.name.to_s
67
+ # EA flags derived attributes with a '/' on the NAME (the
68
+ # visibility slot still shows '+'): 096AF2FD/GM_GriddedSurface
69
+ # renders "+ /columns: Integer" / "+ /rows: Integer".
70
+ base = "/#{base}" if property.is_derived
67
71
  prefix && !prefix.empty? ? "#{prefix}::#{base}" : base
68
72
  end
69
73
 
@@ -129,8 +129,11 @@ module Ea
129
129
  foreign_package_name: foreign_package_name_for(classifier),
130
130
  suppress_stereotypes: suppress_stereotypes?) : []
131
131
  is_classifier = classifier.is_a?(Ea::Model::Classifier)
132
+ # Interfaces DO render attribute compartments when they own
133
+ # attribute rows (936AA434/Surface lists its nine 19107
134
+ # attributes); the earlier corpus evidence for
135
+ # header-only interfaces was zero-attribute leaf types.
132
136
  attr_lines = if is_classifier && show_attributes? &&
133
- !classifier.is_a?(Ea::Model::Interface) &&
134
137
  attributes_visible?(element)
135
138
  Element::AttributeRenderer.lines_for(
136
139
  classifier, lookup: attribute_lookup,
@@ -263,7 +266,7 @@ module Ea
263
266
  first = header_lines.first
264
267
  return theme.compartments.header_top_padding unless first
265
268
 
266
- if first.last == :italic
269
+ if first.last == :italic || first.last == :italic_tight
267
270
  6 # ghost-led: EA seats the right-aligned ghost at +13
268
271
  elsif first.first.to_s.start_with?("«")
269
272
  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
@@ -4,5 +4,5 @@ module Ea
4
4
  # Gem release version. Extracted to its own file so the
5
5
  # `gem-release` tool's `gem bump` can find and update it via the
6
6
  # standard `lib/<gem>/version.rb` convention.
7
- VERSION = "0.6.51"
7
+ VERSION = "0.6.53"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.51
4
+ version: 0.6.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.