From 1ac964d9bac38504f4b7fddc09230c56edf1eff5 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Mon, 3 Sep 2012 12:38:09 +0100 Subject: [PATCH] Ensure saves are expanded in memory when performing translate operations. Fixes #174 --- src/client/GameSave.cpp | 2 ++ src/game/GameController.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index a6a1b8919..7a24c457f 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -297,6 +297,8 @@ char * GameSave::Serialise(int & dataSize) void GameSave::Transform(matrix2d transform, vector2d translate) { + if(Collapsed()) + Expand(); int i, x, y, nx, ny, width = blockWidth*CELL, height = blockHeight*CELL, newWidth, newHeight, newBlockWidth, newBlockHeight; vector2d pos, tmp, ctl, cbr, vel; vector2d cornerso[4]; diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 2c98f877d..860c23ad7 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -447,11 +447,15 @@ void GameController::DrawPoints(int toolSelection, queue & pointQueu void GameController::LoadClipboard() { gameModel->SetPlaceSave(gameModel->GetClipboard()); + if(gameModel->GetPlaceSave() && gameModel->GetPlaceSave()->Collapsed()) + gameModel->GetPlaceSave()->Expand(); } void GameController::LoadStamp() { gameModel->SetPlaceSave(gameModel->GetStamp()); + if(gameModel->GetPlaceSave() && gameModel->GetPlaceSave()->Collapsed()) + gameModel->GetPlaceSave()->Expand(); } void GameController::TranslateSave(ui::Point point)