[gnome-games] quadrapassel: Tidy up workaround for clutter crash on unsized CairoTexture
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] quadrapassel: Tidy up workaround for clutter crash on unsized CairoTexture
- Date: Mon, 6 Feb 2012 09:23:20 +0000 (UTC)
commit 7555a31e38f71ad12ad10c4dfb1c140403f9e4aa
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Feb 6 20:23:09 2012 +1100
quadrapassel: Tidy up workaround for clutter crash on unsized CairoTexture
quadrapassel/src/game-view.vala | 8 +++++---
quadrapassel/src/preview.vala | 3 ++-
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/quadrapassel/src/game-view.vala b/quadrapassel/src/game-view.vala
index 81a96ff..226e12f 100644
--- a/quadrapassel/src/game-view.vala
+++ b/quadrapassel/src/game-view.vala
@@ -113,13 +113,16 @@ public class GameView : GtkClutter.Embed
stage.add_actor (playing_field);
text_overlay = new TextOverlay ();
+ // FIXME: Have to set a size to avoid an assertion in Clutter
+ text_overlay.set_surface_size (1, 1);
stage.add (text_overlay);
block_textures = new BlockTexture[NCOLORS];
for (var i = 0; i < block_textures.length; i++)
{
+ block_textures[i] = new BlockTexture (i);
// FIXME: Have to set a size to avoid an assertion in Clutter
- block_textures[i] = new BlockTexture (i, 1);
+ block_textures[i].set_surface_size (1, 1);
block_textures[i].hide ();
stage.add_actor (block_textures[i]);
}
@@ -427,10 +430,9 @@ public class BlockTexture : Clutter.CairoTexture
}
}
- public BlockTexture (int color, int size)
+ public BlockTexture (int color)
{
auto_resize = true;
- set_surface_size (size, size);
this.color = color.clamp (0, 6);
}
diff --git a/quadrapassel/src/preview.vala b/quadrapassel/src/preview.vala
index 5fcd81e..5f91d00 100644
--- a/quadrapassel/src/preview.vala
+++ b/quadrapassel/src/preview.vala
@@ -58,8 +58,9 @@ public class Preview : GtkClutter.Embed
block_textures = new BlockTexture[NCOLORS];
for (var i = 0; i < block_textures.length; i++)
{
+ block_textures[i] = new BlockTexture (i);
// FIXME: Have to set a size to avoid an assertion in Clutter
- block_textures[i] = new BlockTexture (i, 1);
+ block_textures[i].set_surface_size (1, 1);
block_textures[i].hide ();
stage.add_actor (block_textures[i]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]