Skip to content

Commit

Permalink
Swap vertical/horizontal variables in row/column calculation
Browse files Browse the repository at this point in the history
Currently has no impact as all code-sizes are square, but if support for rectangular DataMatrix would be added, then this would have been an issue.
(I might try to add that support, but I don't know Go 🙂)
  • Loading branch information
huysentruitw authored Feb 9, 2022
1 parent 6c82451 commit 196dd6e
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 196dd6e

Please sign in to comment.