Fix broadcasting context messages

This commit is contained in:
Frank A. Krueger 2017-07-07 22:53:32 -07:00
parent ab708b3cb8
commit 0c38e8213c
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@ namespace Ooui
CanvasRenderingContext2D context2d = new CanvasRenderingContext2D ();
int gotContext2d = 0;
int width = 150;
int width = 300;
public int Width {
get => width;
set => SetProperty (ref width, value <= 0 ? 150 : value, "width");
@ -22,6 +22,7 @@ namespace Ooui
public Canvas ()
: base ("canvas")
{
context2d.MessageSent += Send;
}
public CanvasRenderingContext2D GetContext2D ()

View File

@ -32,7 +32,7 @@ namespace Tests
public void DefaultWidthAndHeight ()
{
var c = new Canvas ();
Assert.AreEqual (150, c.Width);
Assert.AreEqual (300, c.Width);
Assert.AreEqual (150, c.Height);
}