diff --git a/src/main/java/com/threerings/media/tile/util/TileSetTrimmer.java b/src/main/java/com/threerings/media/tile/util/TileSetTrimmer.java index 0aff77f0..6424df23 100644 --- a/src/main/java/com/threerings/media/tile/util/TileSetTrimmer.java +++ b/src/main/java/com/threerings/media/tile/util/TileSetTrimmer.java @@ -21,7 +21,9 @@ package com.threerings.media.tile.util; +import java.awt.AlphaComposite; import java.awt.Dimension; +import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.Area; import java.awt.image.BufferedImage; @@ -165,6 +167,11 @@ public static void trimTileSet ( image = ImageUtil.createCompatibleImage(source.getRawTileSetImage(), bounds.width, bounds.height); + // Empty it out + Graphics2D graphics = (Graphics2D)image.getGraphics(); + graphics.setComposite(AlphaComposite.Clear); + graphics.fillRect(0, 0, bounds.width, bounds.height); + } catch (RasterFormatException rfe) { throw new IOException("Failed to create trimmed tileset image " + "[bounds=" + bounds + ", tset=" + source + ", rfe=" + rfe + "].");