Module: Ea::Svg::EaEmitter::Compartment::Attributes

Defined in:
lib/ea/svg/ea_emitter/compartment/attributes.rb

Overview

Attribute compartment. Skipped when no attribute lines.

Class Method Summary collapse

Class Method Details

.render(context) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ea/svg/ea_emitter/compartment/attributes.rb', line 11

def render(context)
  return nil if context.attr_lines.empty?

  Element::AttributeRenderer.render(
    context.attr_lines,
    bounds: context.bounds,
    first_y: context.geometry.attr_first_y,
    family: context.family, size: context.size, size_unit: context.size_unit,
    fill: context.theme.attribute_text_color,
    visibility_x_offset: context.theme.attribute_spec.visibility_x_offset,
    content_x_offset: context.theme.attribute_spec.content_x_offset
  )
end