From 17f7f84597eb887408f7a5abb64a04c9ee5cb6c2 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 10 Mar 2015 16:52:07 +0100 Subject: [PATCH] Replaced hardcoded values --- src/guiengine/widgets/spinner_widget.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index 9b9670d18..6423df23f 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -445,20 +445,18 @@ void SpinnerWidget::onClick() y += m_parent->getAbsolutePosition().UpperLeftCorner.Y; } - if (m_children[1].m_deactivated) return; - - if (m_children[1].m_properties[PROP_ID] != "spinnerbody" - || !isGauge()) { return; } + if (m_children[1].m_deactivated || + m_children[1].m_properties[PROP_ID] != "spinnerbody" || + !isGauge()) + { + return; + } const core::position2di mouse_position = irr_driver->getDevice()->getCursorControl()->getPosition(); - const int handle_size = m_h*110/128; //need params->m_left_border and params->getImage()->getSize().Height - - rect body_rect = rect(x+handle_size, - y, - x+handle_size + (m_w-2*handle_size), - y+handle_size); + core::recti body_rect + = m_children[1].getIrrlichtElement()->getAbsolutePosition(); if(body_rect.isPointInside(mouse_position)) {