class CTioga2::Graphics::Styles::LegendStorageStyle

Style of a given Legends::LegendStorage object.

Public Class Methods

new() click to toggle source
# File lib/ctioga2/graphics/styles/legend.rb, line 59
def initialize

  # @dy = Types::Dimension.new(:dy, 1.6, :y)

  @vpadding = Types::Dimension.new(:dy, 0.3, :y)

  @picto_width = Types::Dimension.new(:dy, 1.6, :x)
  @picto_height = Types::Dimension.new(:dy, 0.6, :y)

  @picto_to_text = Types::Dimension.new(:dy, 0.3, :x)

  @scale = 0.8
  @text_scale = 0.82
  @symbol_scale = 1

  @frame = BoxStyle.new()
  
  @frame_padding = Types::Dimension.from_text("1mm", :x)
end

Public Instance Methods

dy_to_figure(t) click to toggle source
# File lib/ctioga2/graphics/styles/legend.rb, line 79
def dy_to_figure(t)

  # Defaults to one line height + the padding

  if @dy
    return @dy.to_figure(t, :y)
  end

  line = Types::Dimension.new(:dy, 1, :y) 
  return line.to_figure(t, :y) + @vpadding.to_figure(t, :y)
end
vpadding_to_figure(t) click to toggle source
# File lib/ctioga2/graphics/styles/legend.rb, line 91
def vpadding_to_figure(t)
  if @dy 
    line = Types::Dimension.new(:dy, 1, :y) 
    return (@dy.to_figure(t, :y) - line.to_figure(t, :y))
  end
  return @vpadding.to_figure(t, :y)
end