Browse Source

Add boolean casts to boolean interpretations of object values. This caused compile errors in the Eclipse IDE compiler

pull/107/head
Niklas 5 years ago
parent
commit
e3a7204c56
  1. 8
      core/src/main/java/org/pbjar/jxlayer/plaf/ext/transform/DefaultTransformModel.java

8
core/src/main/java/org/pbjar/jxlayer/plaf/ext/transform/DefaultTransformModel.java

@ -81,7 +81,7 @@ public class DefaultTransformModel implements TransformModel {
AffineTransform transform = transformNoScale(centerX, centerY); AffineTransform transform = transformNoScale(centerX, centerY);
double scaleX = getValue(Type.PreferredScale); double scaleX = getValue(Type.PreferredScale);
transform.translate(centerX, centerY); transform.translate(centerX, centerY);
transform.scale(getValue(Type.Mirror) ? -scaleX : scaleX, scaleX); transform.scale((boolean) getValue(Type.Mirror) ? -scaleX : scaleX, scaleX);
transform.translate(-centerX, -centerY); transform.translate(-centerX, -centerY);
return transform; return transform;
} }
@ -207,7 +207,7 @@ public class DefaultTransformModel implements TransformModel {
double scaleX; double scaleX;
double scaleY; double scaleY;
if (getValue(Type.ScaleToPreferredSize)) { if ((boolean) getValue(Type.ScaleToPreferredSize)) {
scaleX = getValue(Type.PreferredScale); scaleX = getValue(Type.PreferredScale);
scaleY = scaleX; scaleY = scaleX;
} else { } else {
@ -217,14 +217,14 @@ public class DefaultTransformModel implements TransformModel {
scaleX = layer == null ? 0 : layer.getWidth() / bounds.getWidth(); scaleX = layer == null ? 0 : layer.getWidth() / bounds.getWidth();
scaleY = layer == null ? 0 : layer.getHeight() / bounds.getHeight(); scaleY = layer == null ? 0 : layer.getHeight() / bounds.getHeight();
if (getValue(Type.PreserveAspectRatio)) { if ((boolean) getValue(Type.PreserveAspectRatio)) {
scaleX = Math.min(scaleX, scaleY); scaleX = Math.min(scaleX, scaleY);
scaleY = scaleX; scaleY = scaleX;
} }
} }
transform.translate(centerX, centerY); transform.translate(centerX, centerY);
transform.scale(getValue(Type.Mirror) ? -scaleX : scaleX, scaleY); transform.scale((boolean) getValue(Type.Mirror) ? -scaleX : scaleX, scaleY);
transform.translate(-centerX, -centerY); transform.translate(-centerX, -centerY);
transform.concatenate(nonScaledTransform); transform.concatenate(nonScaledTransform);
} }

Loading…
Cancel
Save