Only set opacity if needed

This commit is contained in:
Frank A. Krueger 2017-11-09 17:34:29 -08:00
parent a4a940795e
commit d7cdc88a3e
2 changed files with 8 additions and 2 deletions

View File

@ -149,7 +149,12 @@ namespace Ooui.Forms
else if (width <= 0 || height <= 0) { else if (width <= 0 || height <= 0) {
return; return;
} }
if (opacity >= 1.0f) {
uiview.Style.Opacity = null;
}
else {
uiview.Style.Opacity = opacity; uiview.Style.Opacity = opacity;
}
//var transform = 0; //var transform = 0;
//const double epsilon = 0.001; //const double epsilon = 0.001;

View File

@ -338,7 +338,8 @@ namespace Ooui
var safeValue = value ?? "inherit"; var safeValue = value ?? "inherit";
lock (properties) { lock (properties) {
if (value == null) { if (value == null) {
properties.Remove (propertyName); if (!properties.Remove (propertyName))
return;
} }
else { else {
Value old; Value old;