File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/java.desktop/share/classes/java/awt/font Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 1997, 1999 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1997, 2021 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -155,10 +155,13 @@ public float[] justify(float delta) {
155155 boolean absorbing = hitLimit && absorbweight > 0 ;
156156
157157 // predivide delta by weight
158- float weightedDelta = delta / weight ; // not used if weight == 0
158+ float weightedDelta = 0 ;
159+ if (weight != 0 ) { // not used if weight == 0
160+ weightedDelta = delta / weight ;
161+ }
159162
160163 float weightedAbsorb = 0 ;
161- if (hitLimit && absorbweight > 0 ) {
164+ if (hitLimit && absorbweight != 0 ) {
162165 weightedAbsorb = (delta - gslimit ) / absorbweight ;
163166 }
164167
You can’t perform that action at this time.
0 commit comments