Commit 6209560e authored by mse1's avatar mse1

- Fixed bug in roundint with negative values.

git-svn-id: https://mseide-msegui.svn.sourceforge.net/svnroot/mseide-msegui/trunk@20 56ecf5fe-6917-0410-8ac6-ca8e178bccbf
parent 973fba4b
......@@ -123,7 +123,7 @@ procedure swapbytes1(var value: cardinal); overload;
procedure swaprgb1(var value: cardinal);
function swaprgb(const value: cardinal): cardinal;
function roundint(value: integer; step: integer): integer;
function roundint(const value: integer; const step: integer): integer;
implementation
......@@ -384,9 +384,15 @@ end;
function roundint(value: integer; step: integer): integer;
function roundint(const value: integer; const step: integer): integer;
var
int1: integer;
begin
result:= ((value + step div 2) div step) * step;
int1:= step div 2;
if value < 0 then begin
int1:= -int1;
end;
result:= ((value + int1) div step) * step;
end;
procedure swaprgb1(var value: cardinal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment