File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ private int CalculateBottom()
9999 Span < byte > data = new ( _captureZone . Buffer , row * stride , stride ) ;
100100 for ( int i = 0 ; i < data . Length ; i += 4 )
101101 if ( ( data [ i ] > threshold ) || ( data [ i + 1 ] > threshold ) || ( data [ i + 2 ] > threshold ) )
102- return _captureZone . Height - row ;
102+ return ( _captureZone . Height - 1 ) - row ;
103103 }
104104
105105 return 0 ;
@@ -114,7 +114,8 @@ private int CalculateLeft()
114114 for ( int row = 0 ; row < _captureZone . Height ; row ++ )
115115 {
116116 int offset = ( stride * row ) + ( column * 4 ) ;
117- if ( ( buffer [ offset ] > threshold ) || ( buffer [ offset + 1 ] > threshold ) || ( buffer [ offset + 2 ] > threshold ) ) return column ;
117+ if ( ( buffer [ offset ] > threshold ) || ( buffer [ offset + 1 ] > threshold ) || ( buffer [ offset + 2 ] > threshold ) )
118+ return column ;
118119 }
119120
120121 return 0 ;
@@ -129,7 +130,8 @@ private int CalculateRight()
129130 for ( int row = 0 ; row < _captureZone . Height ; row ++ )
130131 {
131132 int offset = ( stride * row ) + ( column * 4 ) ;
132- if ( ( buffer [ offset ] > threshold ) || ( buffer [ offset + 1 ] > threshold ) || ( buffer [ offset + 2 ] > threshold ) ) return _captureZone . Width - column ;
133+ if ( ( buffer [ offset ] > threshold ) || ( buffer [ offset + 1 ] > threshold ) || ( buffer [ offset + 2 ] > threshold ) )
134+ return ( _captureZone . Width - 1 ) - column ;
133135 }
134136
135137 return 0 ;
You can’t perform that action at this time.
0 commit comments