Permalink
Browse files

MapControl: behavior modification to alow click and drag at any point.

also fixes a minor drawing regression
  • Loading branch information...
bradallred committed Dec 28, 2013
1 parent 5e61626 commit 3305f161664ebfd40f767eb607cfeda0a822f483
Showing with 1 addition and 13 deletions.
  1. +1 −12 gemrb/core/GUI/MapControl.cpp
  2. +0 −1 gemrb/core/GUI/MapControl.h
@@ -88,7 +88,6 @@ MapControl::MapControl(const Region& frame)
NotePosX = 0;
NotePosY = 0;
mouseIsDown = false;
- mouseIsDragging = false;
MarkDirty();
convertToGame = true;
memset(Flag,0,sizeof(Flag) );
@@ -289,9 +288,6 @@ void MapControl::OnMouseOver(unsigned short x, unsigned short y)
ScrollX = 0;
if (ScrollY < 0)
ScrollY = 0;
- }
-
- if (mouseIsDragging) {
ViewHandle(x,y);
}
@@ -407,16 +403,10 @@ void MapControl::OnMouseDown(unsigned short x, unsigned short y, unsigned short
}
mouseIsDown = true;
- short xp = (short) (SCREEN_TO_GAMEX(x));
- short yp = (short) (SCREEN_TO_GAMEY(y));
Region vp = core->GetVideoDriver()->GetViewport();
vp.w = vp.x+ViewWidth*MAP_MULT/MAP_DIV;
vp.h = vp.y+ViewHeight*MAP_MULT/MAP_DIV;
- if ((xp>vp.x) && (xp<vp.w) && (yp>vp.y) && (yp<vp.h)) {
- mouseIsDragging = true;
- } else {
- mouseIsDragging = false;
- }
+ ViewHandle(x,y);
lastMouseX = x;
lastMouseY = y;
}
@@ -431,7 +421,6 @@ void MapControl::OnMouseUp(unsigned short x, unsigned short y, unsigned short Bu
MarkDirty();
mouseIsDown = false;
- mouseIsDragging = false;
switch(Value) {
case MAP_REVEAL:
ViewHandle(x,y);
@@ -55,7 +55,6 @@ class GEM_EXPORT MapControl : public Control {
int NotePosX, NotePosY;
unsigned short lastMouseX, lastMouseY;
bool mouseIsDown;
- bool mouseIsDragging;
bool convertToGame;
// Small map bitmap
Sprite2D* MapMOS;

0 comments on commit 3305f16

Please sign in to comment.