From 3f1a2bfc39af298c35cbd6d53499418eee1b06aa Mon Sep 17 00:00:00 2001 From: Wizjany Date: Wed, 5 Dec 2012 18:31:08 -0500 Subject: [PATCH] Fix off by one error when calculating Poly2D region dimensions. --- .../java/com/sk89q/worldedit/regions/Polygonal2DRegion.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index ebe32b34d..070c5dcdb 100644 --- a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -250,7 +250,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { * @return width */ public int getWidth() { - return max.getBlockX() - min.getBlockX(); + return max.getBlockX() - min.getBlockX() + 1; } /** @@ -259,7 +259,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { * @return height */ public int getHeight() { - return maxY - minY; + return maxY - minY + 1; } /** @@ -268,7 +268,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { * @return length */ public int getLength() { - return max.getBlockZ() - min.getBlockZ(); + return max.getBlockZ() - min.getBlockZ() + 1; } /**