fill.setPropertyBoolean("on", false);
} else {
if (sprite.isFillDirty() || ignoreOptimizations) {
fill.setPropertyBoolean("on", true);
if (sprite.getFill() instanceof Gradient) {
Gradient gradient = (Gradient) sprite.getFill();
// VML angle is offset and inverted from standard, and must be
// adjusted
// to match rotation transform
final double degrees;
if (sprite.getRotation() != null) {
degrees = sprite.getRotation().getDegrees();
} else {
degrees = 0;
}
double angle;
angle = -(gradient.getAngle() + 270 + degrees) % 360.0;
// IE will flip the angle at 0 degrees...
if (angle == 0) {
angle = 180;
}
fill.setPropertyDouble("angle", angle);
fill.setPropertyString("type", "gradient");
fill.setPropertyString("method", "sigma");
StringBuilder stops = new StringBuilder();
for (Stop stop : gradient.getStops()) {
if (stops.length() > 0) {
stops.append(", ");
}
stops.append(stop.getOffset()).append("% ").append(stop.getColor());
}