mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 04:12:52 +08:00
Merge 0d31c74dc5
into aef6ae4872
This commit is contained in:
commit
b4cad8ab81
@ -1646,6 +1646,18 @@ ThickLine( Mat& img, Point2l p0, Point2l p1, const void* color,
|
||||
{
|
||||
static const double INV_XY_ONE = 1./static_cast<double>(XY_ONE);
|
||||
|
||||
Rect_<int64> boundingRect(Point2l(0, 0), (Size2l)img.size());
|
||||
if( (thickness > 1) && (shift == 0) && ( !boundingRect.contains(p0) || !boundingRect.contains(p1) ) )
|
||||
{
|
||||
const int margin = thickness;
|
||||
const Point2l offset(margin, margin);
|
||||
p0 += offset;
|
||||
p1 += offset;
|
||||
clipLine(Size2l(boundingRect.width+2*margin, boundingRect.height+2*margin), p0, p1);
|
||||
p0 -= offset;
|
||||
p1 -= offset;
|
||||
}
|
||||
|
||||
p0.x <<= XY_SHIFT - shift;
|
||||
p0.y <<= XY_SHIFT - shift;
|
||||
p1.x <<= XY_SHIFT - shift;
|
||||
|
Loading…
Reference in New Issue
Block a user