aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/UMenu.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-01-25 20:50:39 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-01-25 20:50:39 +0000
commit8a5aebdd230d32c453292f480be693b08028e619 (patch)
tree0336db627b9b2d101bf4202e2db8d534bfb80cdc /src/menu/UMenu.pas
parente1235ca003a31dd2edb6c2957dd8670508b261ba (diff)
downloadusdx-8a5aebdd230d32c453292f480be693b08028e619.tar.gz
usdx-8a5aebdd230d32c453292f480be693b08028e619.tar.xz
usdx-8a5aebdd230d32c453292f480be693b08028e619.zip
fix software cursor w/ screens = 2
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2096 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/menu/UMenu.pas')
-rw-r--r--src/menu/UMenu.pas12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/menu/UMenu.pas b/src/menu/UMenu.pas
index 3ac487de..b928a612 100644
--- a/src/menu/UMenu.pas
+++ b/src/menu/UMenu.pas
@@ -1642,6 +1642,12 @@ begin
Result:=ParseInput(SDLK_ESCAPE, 0, true);
end;
+ // transfer mousecords to the 800x600 raster we use to draw
+ X := Round((X / (Screen.w / Screens)) * RenderW);
+ if (X > RenderW) then
+ X := X - RenderW;
+ Y := Round((Y / Screen.h) * RenderH);
+
nBut := InteractAt(X, Y);
if nBut >= 0 then
begin
@@ -1657,7 +1663,7 @@ begin
begin
//click button or SelectS
if (Interactions[nBut].Typ = iSelectS) then
- Action := SelectsS[Interactions[nBut].Num].OnClick((X / Screen.w) * RenderW, (Y / Screen.h) * RenderH)
+ Action := SelectsS[Interactions[nBut].Num].OnClick(X, Y)
else
Action := maReturn;
end
@@ -1696,10 +1702,6 @@ end;
function TMenu.InRegion(X, Y: real; A: TMouseOverRect): boolean;
begin
- // transfer mousecords to the 800x600 raster we use to draw
- X := (X / Screen.w) * RenderW;
- Y := (Y / Screen.h) * RenderH;
-
// check whether A contains X and Y
Result := (X >= A.X) and (X <= A.X + A.W) and (Y >= A.Y) and (Y <= A.Y + A.H);
end;