Skip to content

Commit

Permalink
Merge pull request #71 from huysentruitw/patch-1
Browse files Browse the repository at this point in the history
Swap vertical/horizontal variables in row/column calculation
  • Loading branch information
boombuler committed Feb 9, 2022
2 parents 6c82451 + 196dd6e commit abf40d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datamatrix/codesize.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ type dmCodeSize struct {
}

func (s *dmCodeSize) RegionRows() int {
return (s.Rows - (s.RegionCountHorizontal * 2)) / s.RegionCountHorizontal
return (s.Rows - (s.RegionCountVertical * 2)) / s.RegionCountVertical
}

func (s *dmCodeSize) RegionColumns() int {
return (s.Columns - (s.RegionCountVertical * 2)) / s.RegionCountVertical
return (s.Columns - (s.RegionCountHorizontal * 2)) / s.RegionCountHorizontal
}

func (s *dmCodeSize) MatrixRows() int {
return s.RegionRows() * s.RegionCountHorizontal
return s.RegionRows() * s.RegionCountVertical
}

func (s *dmCodeSize) MatrixColumns() int {
return s.RegionColumns() * s.RegionCountVertical
return s.RegionColumns() * s.RegionCountHorizontal
}

func (s *dmCodeSize) DataCodewords() int {
Expand Down

0 comments on commit abf40d2

Please sign in to comment.