ea 0.6.128 → 0.6.129

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.
@@ -92,7 +92,8 @@ module Ea
92
92
  anchor: source_pt, connector: connector,
93
93
  end_kind: :source, tree: tree && tree[:source],
94
94
  heading: (stored_src || stored_labels) && source_heading(connector, points),
95
- stored_labels: stored_labels).each { |t| texts << t }
95
+ stored_labels: stored_labels,
96
+ source_bounds: source_dock_bounds(connector)).each { |t| texts << t }
96
97
  end_renderer.texts(text_box: tgt_tb,
97
98
  mult_box: tgt_mb,
98
99
  anchor: target_pt, connector: connector,
@@ -291,7 +292,9 @@ module Ea
291
292
  theme: theme,
292
293
  font_family: label_font_family,
293
294
  font_size: label_font_size,
294
- font_unit: theme.label_font_size_unit
295
+ font_unit: theme.label_font_size_unit,
296
+ font_weight: label_font_weight,
297
+ font_style: label_font_style
295
298
  )
296
299
  end
297
300
 
@@ -301,7 +304,9 @@ module Ea
301
304
  model_index: model_index,
302
305
  font_family: label_font_family,
303
306
  font_size: label_font_size,
304
- font_unit: theme.label_font_size_unit
307
+ font_unit: theme.label_font_size_unit,
308
+ font_weight: label_font_weight,
309
+ font_style: label_font_style
305
310
  )
306
311
  end
307
312
 
@@ -327,9 +332,19 @@ module Ea
327
332
  end
328
333
 
329
334
  def label_font_family
335
+ return FontResolver::HAND_DRAW_FAMILY if diagram.hand_draw
336
+
330
337
  theme.label_font_family || DEFAULT_FAMILY
331
338
  end
332
339
 
340
+ def label_font_weight
341
+ diagram.hand_draw ? FontResolver::HAND_DRAW_LABEL_WEIGHT : 400
342
+ end
343
+
344
+ def label_font_style
345
+ diagram.hand_draw ? "italic" : "normal"
346
+ end
347
+
333
348
  def label_font_size
334
349
  theme.label_font_size || DEFAULT_SIZE
335
350
  end
@@ -17,10 +17,11 @@ module Ea
17
17
  whole_anchor = whole_at_target ? target : source
18
18
  whole_base = whole_at_target ? before_target : after_source
19
19
  specs = [Registry::Spec.new(shape: diamond_shape(connector, relationship, whole_at_target),
20
- anchor: whole_anchor,
21
- base: whole_base)]
20
+ anchor: whole_anchor, base: whole_base)]
22
21
  return specs unless whole_at_target
23
- return specs if arrow_on_target_diamond?(connector, relationship)
22
+
23
+ target, before_target = target_arrow_points(connector, relationship, target, before_target)
24
+ return specs unless target
24
25
 
25
26
  specs.concat(direction_specs(connector, source, target,
26
27
  before_target, after_source))
@@ -68,14 +69,27 @@ module Ea
68
69
  !whole_end_at_source?(connector)
69
70
  end
70
71
 
71
- # EA draws no arrow where a directed, dest-flagged aggregation
72
- # would put it on its own target diamond.
72
+ # Navigable target-owned aggregations put the arrow at the
73
+ # diamond's inner vertex; nonnavigable targets omit it.
73
74
  def self.arrow_on_target_diamond?(connector, relationship)
74
75
  connector.direction == "Source -> Destination" &&
75
76
  dest_flagged?(relationship)
76
77
  end
77
78
  private_class_method :arrow_on_target_diamond?
78
79
 
80
+ def self.inner_vertex(tip, base)
81
+ tx, ty = tip
82
+ bx, by = base
83
+ dx = bx - tx
84
+ dy = by - ty
85
+ length = Math.hypot(dx, dy)
86
+ return tip if length.zero?
87
+
88
+ depth = Markers::DIAMOND_HALF_H * 2
89
+ [(tx + dx / length * depth).round, (ty + dy / length * depth).round]
90
+ end
91
+ private_class_method :inner_vertex
92
+
79
93
  def self.dest_flagged?(relationship)
80
94
  relationship &&
81
95
  %w[shared composite].include?(relationship.target_aggregation.to_s)
@@ -97,6 +111,16 @@ module Ea
97
111
  base: before_target)]
98
112
  end
99
113
  private_class_method :direction_specs
114
+
115
+ def self.target_arrow_points(connector, relationship, target, before_target)
116
+ return [target, before_target] unless arrow_on_target_diamond?(connector, relationship)
117
+ return [] unless relationship.target_navigable
118
+
119
+ anchor = inner_vertex(target, before_target)
120
+ base = anchor.zip(before_target, target).map { |inner, before, tip| inner + before - tip }
121
+ [anchor, base]
122
+ end
123
+ private_class_method :target_arrow_points
100
124
  end
101
125
  end
102
126
  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.128"
7
+ VERSION = "0.6.129"
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.128
4
+ version: 0.6.129
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -618,8 +618,11 @@ files:
618
618
  - lib/ea/fonts.rb
619
619
  - lib/ea/fonts/cambria_7_regular_widths.json
620
620
  - lib/ea/fonts/cambria_7_styled_widths.json
621
+ - lib/ea/fonts/carlito_gdi_widths.json
621
622
  - lib/ea/fonts/carlito_metrics.json
623
+ - lib/ea/fonts/cjk_fallback_widths.json
622
624
  - lib/ea/fonts/metrics.rb
625
+ - lib/ea/fonts/vertical_metrics.json
623
626
  - lib/ea/guid_format.rb
624
627
  - lib/ea/image.rb
625
628
  - lib/ea/image/emf_renderer.rb
@@ -818,6 +821,7 @@ files:
818
821
  - lib/ea/sources/qea/connector_relationship_map.rb
819
822
  - lib/ea/sources/qea/context_diagram_support.rb
820
823
  - lib/ea/sources/qea/diagram_builder.rb
824
+ - lib/ea/sources/qea/diagram_builder/association_class.rb
821
825
  - lib/ea/sources/qea/diagram_builder/auto_routing.rb
822
826
  - lib/ea/sources/qea/diagram_builder/font_settings.rb
823
827
  - lib/ea/sources/qea/diagram_builder/routing.rb