From e1938f1d401aed7c142c823f964f07ff31b49229 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 22 May 2008 17:48:55 +0000 Subject: further code improvement in TMenu.InRegion git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1119 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenu.pas | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Game') diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas index 102722e4..5fe7d317 100644 --- a/Game/Code/Menu/UMenu.pas +++ b/Game/Code/Menu/UMenu.pas @@ -1422,11 +1422,10 @@ function TMenu.InRegion(X1, Y1, X2, Y2, X, Y: real): boolean; var scaled_x, scaled_y : real; begin - Result := false; + { RenderW and RenderH are defined in Classes/UGraphic.pas } scaled_x := x*640.0/RenderW; scaled_y := x*480.0/RenderH; - if (X1 <= scaled_x) and (scaled_x <= X2) and (Y1 <= scaled_y) and (scaled_y <= Y2) then - Result := true; + Result := (X1 <= scaled_x) and (scaled_x <= X2) and (Y1 <= scaled_y) and (scaled_y <= Y2); end; function TMenu.InStaticRegion(StaticNr: integer; X, Y: integer): boolean; -- cgit v1.2.3