ea 0.6.21 → 0.6.23

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: 548d074902dd1fa399222eecf7bce3890790951fdd62f8d1d5e4c054e602e680
4
- data.tar.gz: 95bc0204957914b6451a505b29adb96d8ad4906229b488406d3cb1b2efcc6f53
3
+ metadata.gz: 97806417f959531420feddb1143826efed14a41349b2e8909402dfba9fa8ba79
4
+ data.tar.gz: c312c7a1706cb9c1d42aa72c254665eea5dc8dc39435f6b8d2531a569bf33566
5
5
  SHA512:
6
- metadata.gz: 71b2b781fbfdc1839b5211aa3d193be4b7daa035fbfa6b1947d8339d71acb8075a80aede566df22cd0709029904be2508203bd726811a27dd9d9be74fd5c2a99
7
- data.tar.gz: 4844d29466fe899fcb10900455dcfcc5f2aecf6f7d77ab25243a78f7ef61f9d85e64db4a1d0432aa13f39d473c38f7452b3738aeb95917dacadc994b747222c4
6
+ metadata.gz: 0df1c576f75d366c43d724f665328602b8ed8f82bf6ff49062e815956f63acd8f624ebb746624092b49307ffbbb28f39ffd22dbac522d32262020416f8e06c6a
7
+ data.tar.gz: e2b89b4df82927308d368fa3896abb5022957fc2b5235ef6f040b1f220aeab10617cca6831784457003aa7e213f13730a40b00e30897fe2dfff5e468d421db41
@@ -139,17 +139,21 @@ module Ea
139
139
  return nil unless tagged_values_count.to_i.positive? ||
140
140
  constraints_count.to_i.positive?
141
141
 
142
- content_bottom_y + size + 5
142
+ (content_bottom_y || raw_attr_first_y) + size + 5
143
143
  end
144
144
 
145
145
  # The lowest content edge among attributes, enum literals,
146
146
  # operations, and constraints — the anchor for trailing
147
147
  # compartments and the autosize height.
148
+ # Nil when no compartment rows render (header-only box):
149
+ # the autosize gate must not treat the empty-compartment
150
+ # anchor as content.
148
151
  def content_bottom_y
149
- bottoms = [attr_bottom_y]
152
+ bottoms = []
153
+ bottoms << attr_bottom_y if attr_lines_count.to_i.positive?
150
154
  bottoms << enum_literals_bottom_y if enum_literals_count.to_i.positive?
151
155
  bottoms << op_bottom_y if op_lines_count.to_i.positive?
152
- bottoms.compact.max
156
+ bottoms.max
153
157
  end
154
158
 
155
159
  def enum_literals_bottom_y
@@ -73,7 +73,8 @@ module Ea
73
73
  off_canvas_parent_name: parent_name,
74
74
  foreign_package_name: foreign_package_name_for(classifier)) : []
75
75
  is_classifier = classifier.is_a?(Ea::Model::Classifier)
76
- attr_lines = if is_classifier && show_attributes?
76
+ attr_lines = if is_classifier && show_attributes? &&
77
+ !classifier.is_a?(Ea::Model::Interface)
77
78
  Element::AttributeRenderer.lines_for(
78
79
  classifier, lookup: attribute_lookup,
79
80
  exclude_association_ids: drawn_association_ids
@@ -84,7 +85,7 @@ module Ea
84
85
  op_lines = (is_classifier && show_operations?) ? Element::OperationRenderer.lines_for(classifier) : []
85
86
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
86
87
  tagged_values_for(classifier).size,
87
- header_lines,
88
+ header_lines, classifier: classifier,
88
89
  constraints_count: constraints_for(classifier).size,
89
90
  marker_count: marker_lines_for(classifier).size,
90
91
  enum_literals_count: enum_row_count_for(classifier))
@@ -100,7 +101,7 @@ module Ea
100
101
  attr_lines = []
101
102
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
102
103
  tagged_values_for(classifier).size,
103
- header_lines,
104
+ header_lines, classifier: classifier,
104
105
  constraints_count: constraints_for(classifier).size,
105
106
  marker_count: marker_lines_for(classifier).size,
106
107
  enum_literals_count: enum_row_count_for(classifier))
@@ -112,7 +113,7 @@ module Ea
112
113
  op_lines = []
113
114
  geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
114
115
  tagged_values_for(classifier).size,
115
- header_lines,
116
+ header_lines, classifier: classifier,
116
117
  constraints_count: constraints_for(classifier).size,
117
118
  marker_count: marker_lines_for(classifier).size,
118
119
  enum_literals_count: enum_row_count_for(classifier))
@@ -145,7 +146,7 @@ module Ea
145
146
  end
146
147
 
147
148
  def compartment_geometry(bounds, size, attr_lines, op_lines,
148
- tagged_count, header_lines,
149
+ tagged_count, header_lines, classifier: nil,
149
150
  constraints_count: 0, marker_count: 0,
150
151
  enum_literals_count: 0)
151
152
  CompartmentGeometry.new(bounds: bounds, size: size,
@@ -156,7 +157,7 @@ module Ea
156
157
  constraints_count: constraints_count,
157
158
  marker_count: marker_count,
158
159
  enum_literals_count: enum_literals_count,
159
- header_top_padding: header_padding_for(header_lines),
160
+ header_top_padding: header_padding_for(header_lines, classifier),
160
161
  header_line_offset: theme.compartments.header_line_offset,
161
162
  divider_offset: theme.compartments.divider_offset,
162
163
  attr_line_offset: theme.compartments.attr_line_offset,
@@ -164,21 +165,29 @@ module Ea
164
165
  end
165
166
 
166
167
  # EA seats a stereotype line 3px higher than a bare class name
167
- # (first baseline +16 vs +19 at 7pt) - verified against the
168
- # EA-published reference SVGs.
169
- def header_padding_for(header_lines)
168
+ # (first baseline +16 vs +19 at 7pt) - and Enumeration /
169
+ # Interface elements seat their stereotype 3px higher still
170
+ # (+13). Corpus-verified by identity-matched elements:
171
+ # Interface +13 x44 vs +16 x17, Enumeration +13 x13 vs +16
172
+ # x3, Class/Object/DataType +16 x515.
173
+ def header_padding_for(header_lines, classifier)
170
174
  first = header_lines.first
171
175
  return theme.compartments.header_top_padding unless first
172
176
 
173
177
  if first.last == :italic
174
178
  6 # ghost-led: EA seats the right-aligned ghost at +13
175
179
  elsif first.first.to_s.start_with?("«")
176
- 9
180
+ enumeration_or_interface?(classifier) ? 6 : 9
177
181
  else
178
182
  theme.compartments.header_top_padding
179
183
  end
180
184
  end
181
185
 
186
+ def enumeration_or_interface?(classifier)
187
+ classifier.is_a?(Ea::Model::Enumeration) ||
188
+ classifier.is_a?(Ea::Model::Interface)
189
+ end
190
+
182
191
  # A stereotype group header («Property») sits 4px below where
183
192
  # plain rows start (divider+18 vs divider+14 at 7pt).
184
193
  def attr_first_offset_for(attr_lines)
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.21"
7
+ VERSION = "0.6.23"
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.21
4
+ version: 0.6.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.