From 841683f19852d203125d93c71e3d1122dbd24298 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Sun, 25 Nov 2012 21:32:04 +0100 Subject: [PATCH] Changed item in geometry check in MapItemsControl. --- MapControl/MapItemsControl.WPF.cs | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/MapControl/MapItemsControl.WPF.cs b/MapControl/MapItemsControl.WPF.cs index 25fcb936..ff474eb4 100644 --- a/MapControl/MapItemsControl.WPF.cs +++ b/MapControl/MapItemsControl.WPF.cs @@ -99,24 +99,10 @@ namespace MapControl private bool IsItemInGeometry(object item, Geometry geometry) { var container = ContainerFromItem(item); - if (container == null) - { - return false; - } - var location = MapPanel.GetLocation(container); - if (location == null) - { - return false; - } - - var parentMap = MapPanel.GetParentMap(container); - if (parentMap == null) - { - return false; - } - - return geometry.FillContains(parentMap.LocationToViewportPoint(location)); + return container != null && + container.RenderTransform != null && + geometry.FillContains(new Point(container.RenderTransform.Value.OffsetX, container.RenderTransform.Value.OffsetY)); } } } \ No newline at end of file