class Squib::Sprues::CropLine
Attributes
x1[R]
x2[R]
y1[R]
y2[R]
Public Class Methods
new(type, position, sheet_width, sheet_height, dpi, cell_px)
click to toggle source
# File lib/squib/sprues/crop_line.rb, line 6 def initialize(type, position, sheet_width, sheet_height, dpi, cell_px) method = "parse_#{type}" send method, position, sheet_width, sheet_height, dpi, cell_px end
Public Instance Methods
parse_horizontal(position, sheet_width, _, dpi, cell_px)
click to toggle source
# File lib/squib/sprues/crop_line.rb, line 11 def parse_horizontal(position, sheet_width, _, dpi, cell_px) position = Args::UnitConversion.parse(position, dpi, cell_px) @x1 = 0 @y1 = position @x2 = sheet_width @y2 = position end
parse_vertical(position, _, sheet_height, dpi, cell_px)
click to toggle source
# File lib/squib/sprues/crop_line.rb, line 19 def parse_vertical(position, _, sheet_height, dpi, cell_px) position = Args::UnitConversion.parse(position, dpi, cell_px) @x1 = position @y1 = 0 @x2 = position @y2 = sheet_height end