Fix Canvas size bugs

This commit is contained in:
Frank A. Krueger 2018-02-01 18:51:00 -08:00
parent 7b9bf65496
commit 0c03a0bf49
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ namespace Ooui
public int Height { public int Height {
get => GetAttribute ("height", 150); get => GetAttribute ("height", 150);
set => SetAttributeProperty ("width", value < 0 ? 0 : value); set => SetAttributeProperty ("height", value < 0 ? 0 : value);
} }
public Canvas () public Canvas ()

View File

@ -58,8 +58,8 @@ namespace Tests
Assert.AreEqual (480, c.Height); Assert.AreEqual (480, c.Height);
c.Width = 0; c.Width = 0;
c.Height = -100; c.Height = -100;
Assert.AreEqual (150, c.Width); Assert.AreEqual (0, c.Width);
Assert.AreEqual (150, c.Height); Assert.AreEqual (0, c.Height);
} }
} }
} }