From 581a8dd955e06296f29cf5f855d580f2c56eb5f0 Mon Sep 17 00:00:00 2001 From: Anuradha Dissanayake Date: Wed, 2 Jan 2013 22:27:26 +1300 Subject: [PATCH] Prevent material selection cursor from going past its bounds --- plugins/workflow.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 8fa26d17f..5d8abc107 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -1630,13 +1630,13 @@ namespace wf_ui static int get_left_margin() { - int left_margin = gps->dimx - 30; - int8_t a = *df::global::ui_menu_width; - int8_t b = *df::global::ui_area_map_width; - if ((a == 1 && b > 1) || (a == 2 && b == 2)) - left_margin -= 24; - - return left_margin; + int left_margin = gps->dimx - 30; + int8_t a = *df::global::ui_menu_width; + int8_t b = *df::global::ui_area_map_width; + if ((a == 1 && b > 1) || (a == 2 && b == 2)) + left_margin -= 24; + + return left_margin; } /* @@ -2498,10 +2498,12 @@ namespace wf_ui else if (input->count(interface_key::CURSOR_LEFT)) { --selected_column; + validateColumn(); } else if (input->count(interface_key::CURSOR_RIGHT)) { selected_column++; + validateColumn(); } else if (enabler->tracking_on && enabler->mouse_lbut) {