|
@@ -43,7 +43,7 @@ type
|
|
|
constructor Create(AOwner: TComponent); override; overload;
|
|
|
procedure Draw(Renderer: TFresnelRenderer); virtual;
|
|
|
procedure DrawCorner(Renderer: TFresnelRenderer; const r: TFresnelRect); virtual;
|
|
|
- function GetHit(const X, Y: TFresnelLength; Nearest: boolean; out aPosition: TFresnelLength): THit; override;
|
|
|
+ function GetHit(const X, Y: TFresnelLength; out aPosition: TFresnelLength): THit; override;
|
|
|
end;
|
|
|
|
|
|
{ TFresnelRenderer }
|
|
@@ -423,7 +423,7 @@ begin
|
|
|
evtMouseDown:
|
|
|
if MouseEvt.Button=mbLeft then
|
|
|
begin
|
|
|
- MouseDownHit:=GetHit(X,Y,false,MouseDownGrabPos);
|
|
|
+ MouseDownHit:=GetHit(X,Y,MouseDownGrabPos);
|
|
|
MouseDownPosition:=Position;
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
|
writeln('TRendererScrollBar.MouseHandler Mouse Down ',Parent.Name,' Horz=',Horizontal,' Hit=',MouseDownHit,' p=',FloatToCSSStr(MouseDownGrabPos));
|
|
@@ -450,7 +450,7 @@ begin
|
|
|
evtMouseMove:
|
|
|
if (MouseEvt.Button=mbLeft) then
|
|
|
begin
|
|
|
- Hit:=GetHit(X,Y,true,p);
|
|
|
+ Hit:=GetHit(X,Y,p);
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
|
writeln('TRendererScrollBar.MouseHandler Mouse Move ',Parent.Name,' Horz=',Horizontal,' Hit=',Hit,' p=',FloatToCSSStr(p),' GrabPos=',FloatToCSSStr(MouseDownGrabPos));
|
|
|
{$ENDIF}
|
|
@@ -465,7 +465,7 @@ begin
|
|
|
evtMouseUp:
|
|
|
if (MouseEvt.Button=mbLeft) then
|
|
|
begin
|
|
|
- Hit:=GetHit(X,Y,true,p);
|
|
|
+ Hit:=GetHit(X,Y,p);
|
|
|
{$IFDEF VerboseFresnelScrolling}
|
|
|
writeln('TRendererScrollBar.MouseHandler Mouse Up ',Parent.Name,' Horz=',Horizontal,' Hit=',Hit,' p=',FloatToCSSStr(p));
|
|
|
{$ENDIF}
|
|
@@ -555,8 +555,7 @@ begin
|
|
|
Renderer.FillRect(TrackColor,r);
|
|
|
end;
|
|
|
|
|
|
-function TRendererScrollBar.GetHit(const X, Y: TFresnelLength; Nearest: boolean; out
|
|
|
- aPosition: TFresnelLength): THit;
|
|
|
+function TRendererScrollBar.GetHit(const X, Y: TFresnelLength; out aPosition: TFresnelLength): THit;
|
|
|
var
|
|
|
LT, RB: TFresnelLength;
|
|
|
begin
|
|
@@ -564,15 +563,11 @@ begin
|
|
|
aPosition:=0;
|
|
|
if Horizontal then
|
|
|
begin
|
|
|
- if (not Nearest) and ((X<Box.Left) or (X>Box.Right)) then
|
|
|
- exit;
|
|
|
LT:=Box.Left+Border;
|
|
|
RB:=Box.Right-Border;
|
|
|
if LT>RB-1 then exit;
|
|
|
aPosition:=(X-LT) / (RB-LT);
|
|
|
end else begin
|
|
|
- if (not Nearest) and ((Y<Box.Top) or (Y>Box.Bottom)) then
|
|
|
- exit;
|
|
|
LT:=Box.Top+Border;
|
|
|
RB:=Box.Bottom-Border;
|
|
|
if LT>RB-1 then exit;
|