ratio = Math.max(ratio, 0.01);
double area = getArea();
- stripWidth = Math.sqrt(area / ratio);
+ stripWidth = MathUtil.safeSqrt(area / ratio);
stripLength = ratio * stripWidth;
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
}
return;
double ratio = Math.max(getAspectRatio(), 0.01);
- stripWidth = Math.sqrt(area / ratio);
+ stripWidth = MathUtil.safeSqrt(area / ratio);
stripLength = ratio * stripWidth;
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
}