Skip to content

Commit

Permalink
TImageWithUrlViewer: added InvertMouseWheel property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kisspeace committed Feb 4, 2023
1 parent d544fe2 commit c016d97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/YDW.FMX.ImageWithURL.ImageViewer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface
{ ❤ --------------- }
FEnableZoomingOutOfFit: boolean;
FBestFitOnDoubleTap: boolean;
FInvertMouseWheel: boolean;
FLastZoomDist: Integer;
FZoomFactor: Single;
FMoveFactor: Single;
Expand Down Expand Up @@ -66,6 +67,7 @@ interface
procedure FitHeight;
property MoveFactor: single read FMoveFactor write FMoveFactor;
property ZoomFactor: single read FZoomFactor write FZoomFactor;
property InvertMouseWheel: boolean read FInvertMouseWheel write FInvertMouseWheel;
property EnableZoomingOutOfFit: boolean read FEnableZoomingOutOfFit write FEnableZoomingOutOfFit;
property BestFitOnDoubleTap: boolean read FBestFitOnDoubleTap write FBestFitOnDoubleTap;
property OnZoomBegin: TZoomingEvent read FOnZoomBegin write FOnZoomBegin;
Expand Down Expand Up @@ -383,6 +385,7 @@ procedure TImageWithUrlViewer.MouseWheel(Shift: TShiftState; WheelDelta: Integer
var Handled: Boolean);
begin
Handled := True;
if FInvertMouseWheel then WheelDelta := -WheelDelta;
Self.DoZoom(WheelDelta);
inherited;
end;
Expand Down

0 comments on commit c016d97

Please sign in to comment.