Commit 295a9815 authored by Leonid Beynenson's avatar Leonid Beynenson

Removed unrequired type conversions in the function clipLine.

parent 509c9101
...@@ -94,14 +94,14 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 ) ...@@ -94,14 +94,14 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 )
if( c1 & 12 ) if( c1 & 12 )
{ {
a = c1 < 8 ? 0 : bottom; a = c1 < 8 ? 0 : bottom;
x1 += (int64) (((int64) (a - y1)) * (x2 - x1) / (y2 - y1)); x1 += (a - y1) * (x2 - x1) / (y2 - y1);
y1 = a; y1 = a;
c1 = (x1 < 0) + (x1 > right) * 2; c1 = (x1 < 0) + (x1 > right) * 2;
} }
if( c2 & 12 ) if( c2 & 12 )
{ {
a = c2 < 8 ? 0 : bottom; a = c2 < 8 ? 0 : bottom;
x2 += (int64) (((int64) (a - y2)) * (x2 - x1) / (y2 - y1)); x2 += (a - y2) * (x2 - x1) / (y2 - y1);
y2 = a; y2 = a;
c2 = (x2 < 0) + (x2 > right) * 2; c2 = (x2 < 0) + (x2 > right) * 2;
} }
...@@ -110,14 +110,14 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 ) ...@@ -110,14 +110,14 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 )
if( c1 ) if( c1 )
{ {
a = c1 == 1 ? 0 : right; a = c1 == 1 ? 0 : right;
y1 += (int64) (((int64) (a - x1)) * (y2 - y1) / (x2 - x1)); y1 += (a - x1) * (y2 - y1) / (x2 - x1);
x1 = a; x1 = a;
c1 = 0; c1 = 0;
} }
if( c2 ) if( c2 )
{ {
a = c2 == 1 ? 0 : right; a = c2 == 1 ? 0 : right;
y2 += (int64) (((int64) (a - x2)) * (y2 - y1) / (x2 - x1)); y2 += (a - x2) * (y2 - y1) / (x2 - x1);
x2 = a; x2 = a;
c2 = 0; c2 = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment