TAChart: Extract DoubleInterval utility function

git-svn-id: trunk@27019 -
This commit is contained in:
ask 2010-08-07 14:32:48 +00:00
parent 493196ea7c
commit a11a0af094

View File

@ -208,6 +208,7 @@ function BoundsSize(ALeft, ATop: Integer; ASize: TSize): TRect; inline;
function DoublePoint(AX, AY: Double): TDoublePoint; inline;
function DoubleRect(AX1, AY1, AX2, AY2: Double): TDoubleRect; inline;
function DoubleInterval(AStart, AEnd: Double): TDoubleInterval; inline;
procedure EnsureOrder(var A, B: Integer); overload; inline;
procedure EnsureOrder(var A, B: Double); overload; inline;
@ -365,6 +366,12 @@ begin
Result.b.Y := AY2;
end;
function DoubleInterval(AStart, AEnd: Double): TDoubleInterval;
begin
Result.FStart := AStart;
Result.FEnd := AEnd;
end;
procedure EnsureOrder(var A, B: Integer); overload; inline;
begin
if A > B then
@ -812,8 +819,7 @@ begin
for k := High(FIntervals) downto i do
FIntervals[k] := FIntervals[k - 1];
end;
FIntervals[i].FStart := AStart;
FIntervals[i].FEnd := AEnd;
FIntervals[i] := DoubleInterval(AStart, AEnd);
Changed;
end;