DemoDrawingArea: Fix sample to actually do some drawing
This commit is contained in:
parent
b2931f22c3
commit
6e6d448cf2
1 changed files with 3 additions and 1 deletions
|
@ -112,6 +112,7 @@ namespace GtkDemo
|
||||||
cr.SetSourceRGB (1, 1, 1);
|
cr.SetSourceRGB (1, 1, 1);
|
||||||
// If we're outside the clip, this will do nothing.
|
// If we're outside the clip, this will do nothing.
|
||||||
cr.Rectangle (i, j, CheckSize, CheckSize);
|
cr.Rectangle (i, j, CheckSize, CheckSize);
|
||||||
|
cr.Fill ();
|
||||||
|
|
||||||
j += CheckSize + Spacing;
|
j += CheckSize + Spacing;
|
||||||
++ycount;
|
++ycount;
|
||||||
|
@ -146,6 +147,7 @@ namespace GtkDemo
|
||||||
surface = widget.Window.CreateSimilarSurface (Cairo.Content.Color, allocation.Width, allocation.Height);
|
surface = widget.Window.CreateSimilarSurface (Cairo.Content.Color, allocation.Width, allocation.Height);
|
||||||
var cr = new Cairo.Context (surface);
|
var cr = new Cairo.Context (surface);
|
||||||
|
|
||||||
|
cr.SetSourceRGB (1, 1, 1);
|
||||||
cr.Paint ();
|
cr.Paint ();
|
||||||
((IDisposable)cr).Dispose ();
|
((IDisposable)cr).Dispose ();
|
||||||
|
|
||||||
|
@ -186,8 +188,8 @@ namespace GtkDemo
|
||||||
var update_rect = new Gdk.Rectangle ((int)x - 3, (int)y - 3, 6, 6);
|
var update_rect = new Gdk.Rectangle ((int)x - 3, (int)y - 3, 6, 6);
|
||||||
var cr = new Cairo.Context (surface);
|
var cr = new Cairo.Context (surface);
|
||||||
|
|
||||||
cr.Fill ();
|
|
||||||
Gdk.CairoHelper.Rectangle (cr, update_rect);
|
Gdk.CairoHelper.Rectangle (cr, update_rect);
|
||||||
|
cr.Fill ();
|
||||||
|
|
||||||
((IDisposable)cr).Dispose ();
|
((IDisposable)cr).Dispose ();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue