Merge pull request #71 from huysentruitw/patch-1

Swap vertical/horizontal variables in row/column calculation
This commit is contained in:
Florian authored and GitHub committed 2022-02-09 09:33:04 +01:00
commit abf40d274d
1 file changed
+4 -4
+4 -4
View File
@@ -10,19 +10,19 @@ type dmCodeSize struct {
} }
func (s *dmCodeSize) RegionRows() int { 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 { 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 { func (s *dmCodeSize) MatrixRows() int {
return s.RegionRows() * s.RegionCountHorizontal return s.RegionRows() * s.RegionCountVertical
} }
func (s *dmCodeSize) MatrixColumns() int { func (s *dmCodeSize) MatrixColumns() int {
return s.RegionColumns() * s.RegionCountVertical return s.RegionColumns() * s.RegionCountHorizontal
} }
func (s *dmCodeSize) DataCodewords() int { func (s *dmCodeSize) DataCodewords() int {