summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/guic.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 02:31:58 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 02:31:58 +0000
commite1f1dbd2ba852c17344b86e9fc131936b4258606 (patch)
tree4bee0b362273c8335b50befd105974a28b498ede /crawl-ref/source/guic.cc
parented05654d265fc1892910a9c6958880837d67560a (diff)
downloadcrawl-ref-e1f1dbd2ba852c17344b86e9fc131936b4258606.tar.gz
crawl-ref-e1f1dbd2ba852c17344b86e9fc131936b4258606.zip
[1940992] Fixed minimap travel/view issues. This fixes both the "off by three squares" as well as an unmentioned "off by two pixels" issue.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4401 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/guic.cc')
-rw-r--r--crawl-ref/source/guic.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/guic.cc b/crawl-ref/source/guic.cc
index 9e3eb26505..daa9266150 100644
--- a/crawl-ref/source/guic.cc
+++ b/crawl-ref/source/guic.cc
@@ -299,7 +299,7 @@ void TileRegionClass::resize(int mx0, int my0, int dx0, int dy0)
if (dy0 != 0) dy = dy0;
}
-MapRegionClass::MapRegionClass(int x, int y, int o_x, int o_y, bool iso)
+MapRegionClass::MapRegionClass(int x, int y, int o_x, int o_y, int marker_len)
{
int i;
@@ -315,6 +315,7 @@ MapRegionClass::MapRegionClass(int x, int y, int o_x, int o_y, bool iso)
x_margin = o_x;
y_margin = o_y;
+ marker_length = marker_len;
force_redraw = false;
SysInit(x, y, o_x, o_y);
@@ -469,8 +470,8 @@ bool RegionClass::mouse_pos(int mouse_x, int mouse_y, int *cx, int *cy)
bool MapRegionClass::mouse_pos(int mouse_x, int mouse_y, int *cx, int *cy)
{
- int x = mouse_x - ox;
- int y = mouse_y - oy;
+ int x = mouse_x - ox - x_margin;
+ int y = mouse_y - oy - y_margin;
if ( x < 0 || y < 0 ) return false;
x /= dx;
y /= dy;