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 +4 -4
- data/lib/ea/svg/ea_emitter/element/package_shape_renderer.rb +18 -9
- 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: 612161a78bd06432a03732a325ff6de795f200d37ee87c4dfe41a0e1b44bb39e
|
|
4
|
+
data.tar.gz: ec6d0535486058e4eaa38ef5fbbd2de7d88a601517f95b31e76142f4f0aa7f8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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 +
|
|
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
|
-
|
|
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
|
-
|
|
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