public static void ExplicitlyChangeLayoutRounding(SceneNode targetNode, PropertyReference filteredProperty) { Base2DElement base2Delement = targetNode as Base2DElement; if (base2Delement == null || !LayoutRoundingHelper.IsUseLayoutRoundingProperty(targetNode, (IProperty)filteredProperty.LastStep)) { return; } LayoutRoundingHelper.SetAutoLayoutRounding((SceneElement)base2Delement, false); }
public static bool UpdateLayoutRounding(SceneElement element) { if (!LayoutRoundingHelper.ShouldConsiderLayoutRoundingAdjustment(element)) { return(false); } IPropertyId propertyKey = (IPropertyId)LayoutRoundingHelper.ResolveUseLayoutRoundingProperty((SceneNode)element); if (propertyKey == null) { return(false); } bool flag1 = element.IsSet(propertyKey) == PropertyState.Set; if (PlatformTypes.Path.IsAssignableFrom((ITypeId)element.Type)) { if (!flag1 && (bool)element.GetComputedValue(propertyKey)) { element.SetLocalValue(Base2DElement.UseLayoutRoundingProperty, (object)false); LayoutRoundingHelper.SetAutoLayoutRounding(element, false); return(true); } } else if (!flag1 || LayoutRoundingHelper.GetAutoLayoutRounding(element)) { bool flag2 = (bool)element.GetComputedValue(propertyKey); if (LayoutRoundingHelper.IsAxisAligned(element)) { if (!flag2) { element.ClearValue(propertyKey); LayoutRoundingHelper.SetAutoLayoutRounding(element, false); return(true); } } else if (flag2) { element.SetValue(propertyKey, (object)false); LayoutRoundingHelper.SetAutoLayoutRounding(element, true); return(true); } } return(false); }