[longomatch] Fix exception drawing when the background is not set
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix exception drawing when the background is not set
- Date: Mon, 7 Jul 2014 11:29:44 +0000 (UTC)
commit 435261420981077922682cc5aed89bcf81a8b5bc
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Jun 19 12:47:02 2014 +0200
Fix exception drawing when the background is not set
LongoMatch.Drawing/Canvas.cs | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Drawing/Canvas.cs b/LongoMatch.Drawing/Canvas.cs
index cb530c7..d14c235 100644
--- a/LongoMatch.Drawing/Canvas.cs
+++ b/LongoMatch.Drawing/Canvas.cs
@@ -231,7 +231,7 @@ namespace LongoMatch.Drawing
Image background;
public BackgroundCanvas (IWidget widget): base (widget) {
- widget.SizeChangedEvent += HandleSizeChangedEvent;;
+ widget.SizeChangedEvent += HandleSizeChangedEvent;
}
public Image Background {
@@ -254,11 +254,13 @@ namespace LongoMatch.Drawing
protected override void HandleDraw (object context, Area area)
{
- tk.Context = context;
- tk.Begin ();
- tk.TranslateAndScale (translation, new Point (scaleX, scaleY));
- tk.DrawImage (Background);
- tk.End ();
+ if (Background != null) {
+ tk.Context = context;
+ tk.Begin ();
+ tk.TranslateAndScale (translation, new Point (scaleX, scaleY));
+ tk.DrawImage (Background);
+ tk.End ();
+ }
base.HandleDraw (context, area);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]