From d7cdc88a3ef4d289e589e0b729392e426a47b876 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Thu, 9 Nov 2017 17:34:29 -0800 Subject: [PATCH] Only set opacity if needed --- Ooui.Forms/VisualElementTracker.cs | 7 ++++++- Ooui/Style.cs | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Ooui.Forms/VisualElementTracker.cs b/Ooui.Forms/VisualElementTracker.cs index 18a5cc9..ab65c78 100644 --- a/Ooui.Forms/VisualElementTracker.cs +++ b/Ooui.Forms/VisualElementTracker.cs @@ -149,7 +149,12 @@ namespace Ooui.Forms else if (width <= 0 || height <= 0) { return; } - uiview.Style.Opacity = opacity; + if (opacity >= 1.0f) { + uiview.Style.Opacity = null; + } + else { + uiview.Style.Opacity = opacity; + } //var transform = 0; //const double epsilon = 0.001; diff --git a/Ooui/Style.cs b/Ooui/Style.cs index 0a8cb08..a92f6d3 100644 --- a/Ooui/Style.cs +++ b/Ooui/Style.cs @@ -338,7 +338,8 @@ namespace Ooui var safeValue = value ?? "inherit"; lock (properties) { if (value == null) { - properties.Remove (propertyName); + if (!properties.Remove (propertyName)) + return; } else { Value old;