# frozen_string_literal: false
# Core SVG data for the trident specification sheet.
#
# This class should never need to be called directly.
# @private
class USPSFlags::Core::TridentSpecs::Delta < USPSFlags::Core::TridentSpecs::Base
def initialize(options = {})
super
@box_top = options[:bt]
@box_bottom = options[:bb]
@box_left = options[:bl]
@box_right = options[:br]
@fly = options[:fly]
@unit = options[:unit]
@heading = options[:heading]
end
def p
<<~SVG
#{@heading}
#{USPSFlags::Core::Icons::Trident.new(:d).svg}
#{boundary_box}
#{right_arrow}
#{left_arrow}
SVG
end
private
def boundary_box
<<~SVG
SVG
end
def right_arrow
<<~SVG
#{gap_height}
#{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom] - @config[:bar_width], @box_bottom - @config[:delta_from_bottom], nil, @box_right, fly: @fly, unit: @unit)}
#{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom], @box_bottom, nil, @box_right, fly: @fly, unit: @unit)}
SVG
end
def gap_height
SA.vertical(@box_right + @config[:bar_width], gap_height_top, @box_bottom - @config[:delta_from_bottom] - @config[:bar_width], @config[:center_point], @config[:center_point] + @config[:delta_gap_width], fly: @fly, unit: @unit)
end
def gap_height_top
@box_bottom - @config[:delta_from_bottom] - @config[:bar_width] - @config[:delta_gap_height]
end
def left_arrow
<<~SVG
#{SA.vertical(@box_left - @config[:bar_width] * 1.5, @box_top, @box_bottom, @box_left, @box_left, label_offset: -BF / 30, label_offset_y: -BF * 2 / 11, label_align: "middle", fly: @fly, unit: @unit)}
SVG
end
end