From 69a160b711732ece6c1038230ece6401597e6c7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 6 Feb 2013 23:41:16 +0300 Subject: Fix onscreen buttons position. New theme option: clickborder - clickable border near onscreen button. --- src/touchmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/touchmanager.cpp') diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 18bcd4a0d..f18c8e12a 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -128,6 +128,9 @@ void TouchManager::loadTouchItem(TouchItem **item, std::string name, y = skin->getOption("y", 10); const int pad = skin->getPadding(); const int pad2 = 2 * pad; + const int border = skin->getOption("clickborder"); + const int border2 = border * 2; + const int diff = pad - border; switch (type) { case LEFT: @@ -141,8 +144,8 @@ void TouchManager::loadTouchItem(TouchItem **item, std::string name, default: break; } - *item = new TouchItem(gcn::Rectangle(x, y, - width + pad2, height + pad2), type, + *item = new TouchItem(gcn::Rectangle(x + diff, y + diff, + width + border2, height + border2), type, eventPressed, eventReleased, images, icon, x + pad, y + pad, width, height, fAll, fPressed, fReleased, fOut); -- cgit v1.2.3-60-g2f50