protected virtual void CreatePolygonForScalableEntity(ElementRuntime element) { NamedObjectSave namedObjectSave = element.AssociatedNamedObjectSave; object scaleXAsObject = namedObjectSave.GetEffectiveValue("ScaleX"); object scaleYAsObject = namedObjectSave.GetEffectiveValue("ScaleY"); if (scaleXAsObject != null && scaleYAsObject != null) { float scaleX = (float)scaleXAsObject; float scaleY = (float)scaleYAsObject; Polygon newPoly = Polygon.CreateRectangle(scaleX, scaleY); InitializeNewPoly(newPoly); newPoly.Position = element.Position; mHighlightShapes.Add(newPoly); newPoly.AttachTo(element, true); newPoly.RelativeRotationZ = 0; } }