Module: TagLayout::InColumns

Defined in:
app/models/tag_layout/in_columns.rb

Overview

Lays out the tags so that they are column ordered.

Class Method Summary collapse

Class Method Details

.directionObject


3
4
5
# File 'app/models/tag_layout/in_columns.rb', line 3

def self.direction
  'column'
end

.tag2_index(row, column, scale, height, width) ⇒ Object


19
20
21
# File 'app/models/tag_layout/in_columns.rb', line 19

def self.tag2_index(row, column, scale, height, width)
  tag_index(row, column, scale, height, width)
end

.tag_index(row, column, scale, height, _width) ⇒ Object

Returns the tag index for the primary tag That is the one laid out in columns with four copies of each


13
14
15
16
17
# File 'app/models/tag_layout/in_columns.rb', line 13

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

.well_order_scopeObject


7
8
9
# File 'app/models/tag_layout/in_columns.rb', line 7

def self.well_order_scope
  :in_column_major_order
end