< prev index next >

src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java

Print this page

        

@@ -220,11 +220,11 @@
 
         outcode1 = outcode(x1, y1, cxmin, cymin, cxmax, cymax);
         outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax);
 
         while ((outcode1 | outcode2) != 0) {
-            int xsteps = 0, ysteps = 0;
+            long xsteps = 0, ysteps = 0;
 
             if ((outcode1 & outcode2) != 0) {
                 return false;
             }
 

@@ -245,11 +245,11 @@
                     }
                     xsteps = xsteps / (2 * ay);
                     if (dx < 0) {
                         xsteps = -xsteps;
                     }
-                    x1 = ucX1 + xsteps;
+                    x1 = ucX1 + (int) xsteps;
                 } else if ((outcode1 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) {
                     if ((outcode1 & OUTCODE_LEFT) != 0) {
                         x1 = cxmin;
                     } else {
                         x1 = cxmax;

@@ -264,11 +264,11 @@
                     }
                     ysteps = ysteps / (2 * ax);
                     if (dy < 0) {
                         ysteps = -ysteps;
                     }
-                    y1 = ucY1 + ysteps;
+                    y1 = ucY1 + (int) ysteps;
                 }
                 outcode1 = outcode(x1, y1, cxmin, cymin, cxmax, cymax);
             } else {
                 if ((outcode2 & (OUTCODE_TOP | OUTCODE_BOTTOM)) != 0) {
                     if ((outcode2 & OUTCODE_TOP) != 0) {

@@ -288,11 +288,11 @@
                     }
                     xsteps = xsteps / (2 * ay);
                     if (dx > 0) {
                         xsteps = -xsteps;
                     }
-                    x2 = ucX2 + xsteps;
+                    x2 = ucX2 + (int) xsteps;
                 } else if ((outcode2 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) {
                     if ((outcode2 & OUTCODE_LEFT) != 0) {
                         x2 = cxmin;
                     } else {
                         x2 = cxmax;

@@ -309,11 +309,11 @@
                     }
                     ysteps = ysteps / (2 * ax);
                     if (dy > 0) {
                         ysteps = -ysteps;
                     }
-                    y2 = ucY2 + ysteps;
+                    y2 = ucY2 + (int) ysteps;
                 }
                 outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax);
             }
         }
 
< prev index next >