ea 0.6.125 → 0.6.127
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78f923bf1924106f7e6853841f3470c198e6ed0c9198e4501acd63aa3e84b3b6
|
|
4
|
+
data.tar.gz: 46975a9dd5d9f80c027a4b7f906abb2dfaff6d7bfdcc8b0af82f3ce390f6a2c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9b5fcacddafe90bac1b21015a6649227fd9676e01e8f5367e9eec96c0eac8712ff6303e49fadfa1d3db0c19c648eec056030ddcdb0e8d68609191502fd26193
|
|
7
|
+
data.tar.gz: 3f95877c62d6dc05b74096bba8ecd49961a2c40bd363a98fde2d5e27f53a31e43ecb871a210e010ef5721b7c6e4d58c2cd94c6bf16e3826a712e80c1f0f7055e
|
|
@@ -555,7 +555,7 @@ module Ea
|
|
|
555
555
|
end
|
|
556
556
|
|
|
557
557
|
# A width-2 Mode 3 route without a tree style keeps authored orthogonal
|
|
558
|
-
# bends: two corners for Associations,
|
|
558
|
+
# bends: two corners for Associations, two or more for Aggregations.
|
|
559
559
|
# Each end docks on
|
|
560
560
|
# the 1px outline its adjacent leg points at, from the corner's own
|
|
561
561
|
# coordinate; any end that cannot do so leaves the route unchanged.
|
|
@@ -569,7 +569,13 @@ module Ea
|
|
|
569
569
|
|
|
570
570
|
first = outline_dock(corners[0], corners[1], source)
|
|
571
571
|
last = outline_dock(corners[-1], corners[-2], target)
|
|
572
|
-
|
|
572
|
+
return nil unless distinct_stair_docks?(corners, first, last)
|
|
573
|
+
|
|
574
|
+
[first, *corners, last]
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
def distinct_stair_docks?(corners, first, last)
|
|
578
|
+
first && last && first != corners.first && last != corners.last
|
|
573
579
|
end
|
|
574
580
|
|
|
575
581
|
def stair_style?(link_row, connector)
|
|
@@ -579,7 +585,7 @@ module Ea
|
|
|
579
585
|
end
|
|
580
586
|
|
|
581
587
|
def stair_corner_count?(corners, connector_type)
|
|
582
|
-
connector_type == "Association" ? corners.size == 2 : corners.size >=
|
|
588
|
+
connector_type == "Association" ? corners.size == 2 : corners.size >= 2
|
|
583
589
|
end
|
|
584
590
|
|
|
585
591
|
# Every leg is non-zero and runs along the opposite axis of the last.
|
|
@@ -70,7 +70,7 @@ module Ea
|
|
|
70
70
|
content = "#{slot.name} #{slot.op} #{slot.value}"
|
|
71
71
|
TextRenderer.new(
|
|
72
72
|
content: content,
|
|
73
|
-
x: bounds.x + (context
|
|
73
|
+
x: bounds.x + content_x_offset(context),
|
|
74
74
|
y: y_pos,
|
|
75
75
|
family: context.family, size: context.size,
|
|
76
76
|
size_unit: context.size_unit, logical_height: context.logical_height, fill: fill
|
|
@@ -78,6 +78,16 @@ module Ea
|
|
|
78
78
|
end
|
|
79
79
|
module_function :line_text
|
|
80
80
|
|
|
81
|
+
def content_x_offset(context)
|
|
82
|
+
offset = context.theme.attribute_spec.content_x_offset || 26
|
|
83
|
+
if Ea::Fonts::Metrics.compact_compartment_font?(context.size,
|
|
84
|
+
family: context.family, unit: context.size_unit)
|
|
85
|
+
offset -= 1
|
|
86
|
+
end
|
|
87
|
+
offset
|
|
88
|
+
end
|
|
89
|
+
module_function :content_x_offset
|
|
90
|
+
|
|
81
91
|
def subtitle_text(text, bounds, y_pos, context, fill)
|
|
82
92
|
estimated_width = text.length * context.size * 0.5
|
|
83
93
|
x_pos = bounds.x + (bounds.width - estimated_width) / 2.0
|
|
@@ -154,18 +154,11 @@ module Ea
|
|
|
154
154
|
(block_left + (block_right - block_left - title_text_width.round) / 2.0).floor
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
-
CJK_RANGE = /[\u3000-\u9fff\uff00-\uffef]/
|
|
158
|
-
|
|
159
|
-
# Real font metrics when available; legacy per-char
|
|
160
|
-
# estimate otherwise (families without metric tables).
|
|
161
157
|
def estimated_width(text, size, weight: nil, logical_height: nil, text_family: family)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
text.to_s.each_char.sum do |ch|
|
|
167
|
-
ch.match?(CJK_RANGE) ? size * 0.70 : size * 0.612
|
|
168
|
-
end
|
|
158
|
+
TextRenderer.estimate_width(
|
|
159
|
+
text, size, family: text_family, weight: weight,
|
|
160
|
+
logical_height: logical_height
|
|
161
|
+
).round
|
|
169
162
|
end
|
|
170
163
|
|
|
171
164
|
def widest_item_label_width
|
data/lib/ea/version.rb
CHANGED