From 2d22776a2c8bfe2cdc6b370721daed5a470159a6 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 29 Oct 2013 19:59:13 +0000 Subject: [PATCH] Iterate through signs in reverse order when seeking for click events in order to ensure when clicking on stacked signs the top-most sign is detected --- src/gui/game/GameController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index cfcb5e6cf..17660ec5f 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -255,7 +255,7 @@ GameView * GameController::GetView() sign * GameController::GetSignAt(int x, int y){ Simulation * sim = gameModel->GetSimulation(); - for (std::vector::iterator iter = sim->signs.begin(), end = sim->signs.end(); iter != end; ++iter) + for (std::vector::reverse_iterator iter = sim->signs.rbegin(), end = sim->signs.rend(); iter != end; ++iter) { int signx, signy, signw, signh; (*iter).pos((*iter).getText(sim), signx, signy, signw, signh);