summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-10-20 18:39:45 +0000
committeralberth <alberth@openttd.org>2009-10-20 18:39:45 +0000
commit7658bac2b5591c257bd58bf0d732938394b307bb (patch)
tree1282716a305f08657dd0dfd31e37bf3d640654f9 /src
parentbfedac1166cf84619d8304f42b5681bdbd5686b7 (diff)
downloadopenttd-7658bac2b5591c257bd58bf0d732938394b307bb.tar.xz
(svn r17823) -Codechange: Use top of the matrix widget as offset for row calculation in autoreplace window.
Diffstat (limited to 'src')
-rw-r--r--src/autoreplace_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index fd6a531c0..198e22f25 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -419,7 +419,7 @@ public:
case RVW_WIDGET_LEFT_MATRIX:
case RVW_WIDGET_RIGHT_MATRIX: {
- uint i = (pt.y - 14) / this->resize.step_height;
+ uint i = (pt.y - this->GetWidget<NWidgetBase>(RVW_WIDGET_LEFT_MATRIX)->pos_y) / this->resize.step_height;
uint16 click_scroll_pos = widget == RVW_WIDGET_LEFT_MATRIX ? this->vscroll.GetPosition() : this->vscroll2.GetPosition();
uint16 click_scroll_cap = widget == RVW_WIDGET_LEFT_MATRIX ? this->vscroll.GetCapacity() : this->vscroll2.GetCapacity();
byte click_side = widget == RVW_WIDGET_LEFT_MATRIX ? 0 : 1;