< prev index next >

modules/javafx.graphics/src/main/java/com/sun/marlin/CollinearSimplifier.java

Print this page




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


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