Class: Ea::Svg::EaEmitter::Marker::Plus

Inherits:
Kind
  • Object
show all
Defined in:
lib/ea/svg/ea_emitter/marker/plus.rb

Overview

Plus-symbol marker at the contained end of a Nesting connector. EA renders a "+" (16x16, two crossed lines) at the end pointing INTO the container.

Path encoding (two sub-paths in one ):

M cx cy-8 L cx cy+8    (vertical arm, 16 tall)
M cx+8 cy L cx-8 cy    (horizontal arm, 16 wide)

cx, cy = plus center, anchored at the source-end waypoint.

Constant Summary collapse

ARM_LENGTH =
8

Class Method Summary collapse

Methods inherited from Kind

whole_end_at_source?

Class Method Details

.handles?(effective_type) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ea/svg/ea_emitter/marker/plus.rb', line 20

def self.handles?(effective_type)
  effective_type == "Nesting"
end

.specs_for(connector, source, target, before_target, after_source, relationship: nil) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/ea/svg/ea_emitter/marker/plus.rb', line 24

def self.specs_for(connector, source, target, before_target, after_source, relationship: nil)
  # Plus is at the contained (child) end. EA's convention:
  # source end is the child, target end is the parent.
  # Default to source unless the connector direction
  # reverses the ends.
  whole_end_at_source = whole_end_at_source?(connector)
  anchor = whole_end_at_source ? source : target
  base = whole_end_at_source ? after_source : before_target
  [Registry::Spec.new(shape: :plus, anchor: anchor, base: base)]
end