Fix broadcasting context messages
This commit is contained in:
parent
ab708b3cb8
commit
0c38e8213c
|
@ -7,7 +7,7 @@ namespace Ooui
|
||||||
CanvasRenderingContext2D context2d = new CanvasRenderingContext2D ();
|
CanvasRenderingContext2D context2d = new CanvasRenderingContext2D ();
|
||||||
int gotContext2d = 0;
|
int gotContext2d = 0;
|
||||||
|
|
||||||
int width = 150;
|
int width = 300;
|
||||||
public int Width {
|
public int Width {
|
||||||
get => width;
|
get => width;
|
||||||
set => SetProperty (ref width, value <= 0 ? 150 : value, "width");
|
set => SetProperty (ref width, value <= 0 ? 150 : value, "width");
|
||||||
|
@ -22,6 +22,7 @@ namespace Ooui
|
||||||
public Canvas ()
|
public Canvas ()
|
||||||
: base ("canvas")
|
: base ("canvas")
|
||||||
{
|
{
|
||||||
|
context2d.MessageSent += Send;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CanvasRenderingContext2D GetContext2D ()
|
public CanvasRenderingContext2D GetContext2D ()
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Tests
|
||||||
public void DefaultWidthAndHeight ()
|
public void DefaultWidthAndHeight ()
|
||||||
{
|
{
|
||||||
var c = new Canvas ();
|
var c = new Canvas ();
|
||||||
Assert.AreEqual (150, c.Width);
|
Assert.AreEqual (300, c.Width);
|
||||||
Assert.AreEqual (150, c.Height);
|
Assert.AreEqual (150, c.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue