From f3c9a59d2945ea837ceacf01590514b5e893984e Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Fri, 10 Sep 2010 21:35:08 +0000 Subject: [PATCH] Fix layout errors and crash with Atlas terrain previews. Fix warning. This was SVN commit r8103. --- binaries/data/tools/atlas/scripts/section/terrain.js | 5 +++++ source/tools/atlas/AtlasScript/ScriptInterface.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/binaries/data/tools/atlas/scripts/section/terrain.js b/binaries/data/tools/atlas/scripts/section/terrain.js index 2be89f9949..7b852f0ea0 100644 --- a/binaries/data/tools/atlas/scripts/section/terrain.js +++ b/binaries/data/tools/atlas/scripts/section/terrain.js @@ -78,9 +78,12 @@ function TerrainPreviewPage(panel, name) } TerrainPreviewPage.prototype = { reloadPreviews: function() { + this.panel.freeze(); this.scrolled.destroyChildren(); this.itemSizer.clear(); + lastTerrainSelection = null; // clear any reference to deleted window + // TODO: Do something clever like load the preview images asynchronously, // to avoid the annoying freeze when switching tabs var previews = Atlas.Message.GetTerrainGroupPreviews(this.name, this.w, this.h).previews; @@ -106,7 +109,9 @@ TerrainPreviewPage.prototype = { this.itemSizer.add(imgSizer, 0, wxAlignment.CENTRE | wxStretch.EXPAND); } + this.itemSizer.layout(); this.panel.layout(); + this.panel.thaw(); // If not all textures were loaded yet, run a timer to reload the previews // every so often until they've all finished diff --git a/source/tools/atlas/AtlasScript/ScriptInterface.cpp b/source/tools/atlas/AtlasScript/ScriptInterface.cpp index 7b8a5e115e..a31c99231b 100644 --- a/source/tools/atlas/AtlasScript/ScriptInterface.cpp +++ b/source/tools/atlas/AtlasScript/ScriptInterface.cpp @@ -230,7 +230,7 @@ namespace template<> struct ToJSVal { - static jsval Convert(JSContext* cx, const bool& val) + static jsval Convert(JSContext* WXUNUSED(cx), const bool& val) { return val ? JSVAL_TRUE : JSVAL_FALSE; }