Skip to content

Commit 726ed26

Browse files
committed
Merge pull request opencv#3469 from a-wi:Fill_ellipse_arc_v3
2 parents bf5ff7f + 41afe54 commit 726ed26

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/imgproc/src/drawing.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,10 +1190,15 @@ FillEdgeCollection( Mat& img, std::vector<PolyEdge>& edges, const void* color )
11901190
{
11911191
PolyEdge& e1 = edges[i];
11921192
assert( e1.y0 < e1.y1 );
1193+
// Determine x-coordinate of the end of the edge.
1194+
// (This is not necessary x-coordinate of any vertex in the array.)
1195+
int x1 = e1.x + (e1.y1 - e1.y0) * e1.dx;
11931196
y_min = std::min( y_min, e1.y0 );
11941197
y_max = std::max( y_max, e1.y1 );
11951198
x_min = std::min( x_min, e1.x );
11961199
x_max = std::max( x_max, e1.x );
1200+
x_min = std::min( x_min, x1 );
1201+
x_max = std::max( x_max, x1 );
11971202
}
11981203

11991204
if( y_max < 0 || y_min >= size.height || x_max < 0 || x_min >= (size.width<<XY_SHIFT) )

0 commit comments

Comments
 (0)