jdk/src/java.desktop/share/classes/sun/java2d/marlin/CollinearSimplifier.java
changeset 47126 188ef162f019
parent 34417 57a3863abbb4
equal deleted inserted replaced
45093:c42dc7b58b4d 47126:188ef162f019
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   144         }
   144         }
   145     }
   145     }
   146 
   146 
   147     private static float getSlope(float x1, float y1, float x2, float y2) {
   147     private static float getSlope(float x1, float y1, float x2, float y2) {
   148         float dy = y2 - y1;
   148         float dy = y2 - y1;
   149         if (dy == 0f) {
   149         if (dy == 0.0f) {
   150             return (x2 > x1) ? Float.POSITIVE_INFINITY
   150             return (x2 > x1) ? Float.POSITIVE_INFINITY
   151                    : Float.NEGATIVE_INFINITY;
   151                    : Float.NEGATIVE_INFINITY;
   152         }
   152         }
   153         return (x2 - x1) / dy;
   153         return (x2 - x1) / dy;
   154     }
   154     }