Fix Canvas size bugs
This commit is contained in:
parent
7b9bf65496
commit
0c03a0bf49
|
@ -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 ()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue