ea 0.6.110 → 0.6.111

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: 55380e3923a2afe6babb0b3163079cc273e7f054cc8d1549db7985ace1f45757
4
- data.tar.gz: dd92a38559eb5c1688771391995247055d633530fdcb4712a62aa087a31bfbf4
3
+ metadata.gz: 612161a78bd06432a03732a325ff6de795f200d37ee87c4dfe41a0e1b44bb39e
4
+ data.tar.gz: ec6d0535486058e4eaa38ef5fbbd2de7d88a601517f95b31e76142f4f0aa7f8a
5
5
  SHA512:
6
- metadata.gz: 9c98de5218163ad487eb0453bcf8fca9ea844a8cecbe3d36856ce2a44ab5728a691792d9a112c9efdf4f1e4084360a655052494af40764e339f0086692c8f6d8
7
- data.tar.gz: 83fe0979cd7213d32a2615efd5d8e4f54f22c4c94761f5ec8bc15da01adf5070878fe937475a7424a8e8afc144cff1b0bc3620137bd491584d59cbb4733a75cf
6
+ metadata.gz: 2374fbd101b31c488752c90eced651591271fa54ef2c5ae104641c8ae02c6183f5d62b17cb8b46e2b8a790728f04df6cea7e17d66c80feb699ab4fdcad55e686
7
+ data.tar.gz: 52d024c1f2cf5e2c1e2d69b4b1c9d1313aa27ab2548c36ca3232f9122de71e7dc21d0b8824a7f4a4803722afd57942660642bde9997240529b4b62945f25321a
@@ -29,7 +29,7 @@ module Ea
29
29
  TAB_LABEL_PADDING = 10
30
30
  TAB_LABEL_X_OFFSET = 5
31
31
  TAB_LABEL_Y_OFFSET = 13
32
- TAB_LINE_OFFSET = 13
32
+ TAB_TEXT_PADDING = 6
33
33
  DEFAULT_TAB_WIDTH = 105
34
34
  # EA autosizes the TAB: max(text width + 15, 105). The BODY
35
35
  # width = max(stored rect, tab + 15): user-widened packages
@@ -116,21 +116,30 @@ module Ea
116
116
  bounds.x + TAB_LABEL_X_OFFSET
117
117
  end
118
118
 
119
- # Stereotype line baseline: 13px below the tab top.
120
119
  def stereotype_y
121
- tab_top_y + TAB_LABEL_Y_OFFSET
120
+ tab_top_y + first_baseline_offset
122
121
  end
123
122
 
124
- # Name baseline when stereotype is also rendered: 26px below
125
- # the tab top (one line below the stereotype).
126
123
  def name_y
127
- tab_top_y + TAB_LABEL_Y_OFFSET + TAB_LINE_OFFSET
124
+ stereotype_y + tab_line_height
128
125
  end
129
126
 
130
- # Name baseline when only the name renders (no stereotype):
131
- # 13px below the tab top.
132
127
  def name_y_single
133
- tab_top_y + TAB_LABEL_Y_OFFSET
128
+ stereotype_y
129
+ end
130
+
131
+ # Package tabs use the same font-size-plus-padding anchor as
132
+ # classifier headers, with a smaller top inset.
133
+ def first_baseline_offset
134
+ size_unit == "pt" ? size + TAB_TEXT_PADDING : TAB_LABEL_Y_OFFSET
135
+ end
136
+
137
+ def tab_line_height
138
+ return TAB_LABEL_Y_OFFSET unless size_unit == "pt"
139
+
140
+ Ea::Fonts::Metrics.compartment_line_height(
141
+ size, family: family, unit: size_unit, offset: TAB_TEXT_PADDING
142
+ )
134
143
  end
135
144
 
136
145
  # Tab occupies the top of the stored rect.
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.110"
7
+ VERSION = "0.6.111"
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.110
4
+ version: 0.6.111
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.