From 95ff914ab680d6a67409a0755d18b8eeb9f7ad54 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Tue, 21 Mar 2006 02:32:27 +0000 Subject: [PATCH] Deal with blank tiles by returning a 1x1 blank pixel rather than a bunch of invalid values. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3965 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/media/image/ImageUtil.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/media/image/ImageUtil.java b/src/java/com/threerings/media/image/ImageUtil.java index 6bd5be85b..db173e407 100644 --- a/src/java/com/threerings/media/image/ImageUtil.java +++ b/src/java/com/threerings/media/image/ImageUtil.java @@ -560,10 +560,18 @@ public class ImageUtil } // fill in the dimensions - tbounds.x = minx; - tbounds.y = firstrow; - tbounds.width = maxx - minx + 1; - tbounds.height = lastrow - firstrow + 1; + if (firstrow != -1) { + tbounds.x = minx; + tbounds.y = firstrow; + tbounds.width = maxx - minx + 1; + tbounds.height = lastrow - firstrow + 1; + } else { + // Entirely blank image. Return 1x1 blank image. + tbounds.x = 0; + tbounds.y = 0; + tbounds.width = 1; + tbounds.height = 1; + } } /**