Module: Limber::TagLayoutTemplate::InColumns

Defined in:
app/models/limber/tag_layout_template/in_columns.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#primary_index(row, column, scale, height, _width) ⇒ Integer

Returns the tag index for the primary (i7) tag That is the one laid out in columns with four copies of each i5 follows the same pattern, but isn’t actually shown in limber

Parameters:

  • row (Integer)

    Zero indexed row co-ordinate of the well

  • column (Integer)

    Zero-indexed column co-ordinate of the well

  • scale (Integer)

    The number of times each tag is repeated in a given row/column. eg. 2 for quad stamps.

  • height (Integer)

    The number of rows on a plate

  • _width (Integer)

    The number of columns on a plate (unused)

Returns:

  • (Integer)

    The index of the tag to use for the well



23
24
25
26
27
# File 'app/models/limber/tag_layout_template/in_columns.rb', line 23

def primary_index(row, column, scale, height, _width)
  tag_col = (column / scale)
  tag_row = (row / scale)
  tag_row + (height / scale * tag_col)
end