From 0c03a0bf49658b9881f391073e27ce5f2a225940 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Thu, 1 Feb 2018 18:51:00 -0800 Subject: [PATCH] Fix Canvas size bugs --- Ooui/Canvas.cs | 2 +- Tests/CanvasTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ooui/Canvas.cs b/Ooui/Canvas.cs index 2c009ac..66ff2cb 100644 --- a/Ooui/Canvas.cs +++ b/Ooui/Canvas.cs @@ -14,7 +14,7 @@ namespace Ooui public int Height { get => GetAttribute ("height", 150); - set => SetAttributeProperty ("width", value < 0 ? 0 : value); + set => SetAttributeProperty ("height", value < 0 ? 0 : value); } public Canvas () diff --git a/Tests/CanvasTests.cs b/Tests/CanvasTests.cs index ac8def7..dc93a19 100644 --- a/Tests/CanvasTests.cs +++ b/Tests/CanvasTests.cs @@ -58,8 +58,8 @@ namespace Tests Assert.AreEqual (480, c.Height); c.Width = 0; c.Height = -100; - Assert.AreEqual (150, c.Width); - Assert.AreEqual (150, c.Height); + Assert.AreEqual (0, c.Width); + Assert.AreEqual (0, c.Height); } } }