< prev index next >

src/java.desktop/share/classes/sun/java2d/marlin/CollinearSimplifier.java

Print this page




 129                 // emit previous segment
 130                 delegate.lineTo(px2, py2);
 131                 px1 = px2;
 132                 py1 = py2;
 133                 px2 = x;
 134                 py2 = y;
 135                 pslope = slope;
 136                 return;
 137             default:
 138         }
 139     }
 140 
 141     private void emitStashedLine() {
 142         if (state == SimplifierState.PreviousLine) {
 143             delegate.lineTo(px2, py2);
 144         }
 145     }
 146 
 147     private static float getSlope(float x1, float y1, float x2, float y2) {
 148         float dy = y2 - y1;
 149         if (dy == 0f) {
 150             return (x2 > x1) ? Float.POSITIVE_INFINITY
 151                    : Float.NEGATIVE_INFINITY;
 152         }
 153         return (x2 - x1) / dy;
 154     }
 155 }


 129                 // emit previous segment
 130                 delegate.lineTo(px2, py2);
 131                 px1 = px2;
 132                 py1 = py2;
 133                 px2 = x;
 134                 py2 = y;
 135                 pslope = slope;
 136                 return;
 137             default:
 138         }
 139     }
 140 
 141     private void emitStashedLine() {
 142         if (state == SimplifierState.PreviousLine) {
 143             delegate.lineTo(px2, py2);
 144         }
 145     }
 146 
 147     private static float getSlope(float x1, float y1, float x2, float y2) {
 148         float dy = y2 - y1;
 149         if (dy == 0.0f) {
 150             return (x2 > x1) ? Float.POSITIVE_INFINITY
 151                    : Float.NEGATIVE_INFINITY;
 152         }
 153         return (x2 - x1) / dy;
 154     }
 155 }
< prev index next >