Index: Core/Components/src/Core.Components.DotSpatial.Forms/DotSpatialMap.cs =================================================================== diff -u -r13760a0b773a8848cc0c53d39c0696f47776168b -r875d329b28c816293fbf2aa57d6c2f833e67b81c --- Core/Components/src/Core.Components.DotSpatial.Forms/DotSpatialMap.cs (.../DotSpatialMap.cs) (revision 13760a0b773a8848cc0c53d39c0696f47776168b) +++ Core/Components/src/Core.Components.DotSpatial.Forms/DotSpatialMap.cs (.../DotSpatialMap.cs) (revision 875d329b28c816293fbf2aa57d6c2f833e67b81c) @@ -48,7 +48,7 @@ var x = ViewExtents.Center.X; var y = ViewExtents.Center.Y; var newExtents = new Extent(x - minExt/2, y - minExt/2, x + minExt/2, y + minExt/2); // resize to stay above the minExt - if (!ViewExtents.Equals(newExtents)) + if (!ExtentEquals(ViewExtents, newExtents)) { ViewExtents = newExtents; } @@ -57,6 +57,31 @@ base.OnViewExtentsChanged(sender, args); } + private static bool ExtentEquals(IExtent obj, IExtent other) + { + if (obj == null || other == null) + { + return false; + } + if (Math.Abs(obj.MinX - other.MinX) > minExt) + { + return false; + } + if (Math.Abs(obj.MaxX - other.MaxX) > minExt) + { + return false; + } + if (Math.Abs(obj.MinY - other.MinY) > minExt) + { + return false; + } + if (Math.Abs(obj.MaxY - other.MaxY) > minExt) + { + return false; + } + return true; + } + private static double RoundDouble(double value, int numberOfDecimalPlaces) { return IsSpecialDoubleValue(value) ?