mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Viewer - zoom image
This commit is contained in:
parent
8725b8ceac
commit
c4c8e69189
1 changed files with 13 additions and 9 deletions
|
|
@ -3,7 +3,7 @@
|
|||
-------------------------------------------------------------------------
|
||||
Build-in File Viewer.
|
||||
|
||||
Copyright (C) 2007-2023 Alexander Koblov (alexx2000@mail.ru)
|
||||
Copyright (C) 2007-2024 Alexander Koblov (alexx2000@mail.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -437,6 +437,7 @@ type
|
|||
|
||||
procedure ShowTextViewer(AMode: TViewerControlMode);
|
||||
procedure CopyMoveFile(AViewerAction:TViewerCopyMoveAction);
|
||||
procedure ZoomImage(ADelta: Double);
|
||||
procedure RotateImage(AGradus:integer);
|
||||
procedure MirrorImage(AVertically:boolean=False);
|
||||
|
||||
|
|
@ -1622,6 +1623,12 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.ZoomImage(ADelta: Double);
|
||||
begin
|
||||
FZoomFactor := Round(FZoomFactor * ADelta);
|
||||
AdjustImageSize;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.RotateImage(AGradus: integer);
|
||||
// AGradus now supported only 90,180,270 values
|
||||
var
|
||||
|
|
@ -3495,22 +3502,19 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmViewer.cm_Zoom(const Params: array of string);
|
||||
var
|
||||
K: Double;
|
||||
begin
|
||||
if miGraphics.Checked then
|
||||
try
|
||||
K:= StrToFloat(Params[0]);
|
||||
ZoomImage(StrToFloat(Params[0]));
|
||||
except
|
||||
Exit;
|
||||
// Exit
|
||||
end;
|
||||
FZoomFactor := Round(FZoomFactor * K);
|
||||
AdjustImageSize;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.cm_ZoomIn(const Params: array of string);
|
||||
begin
|
||||
if miGraphics.Checked then
|
||||
cm_Zoom(['1.1'])
|
||||
ZoomImage(1.1)
|
||||
else
|
||||
begin
|
||||
gFonts[dcfViewer].Size:=gFonts[dcfViewer].Size+1;
|
||||
|
|
@ -3522,7 +3526,7 @@ end;
|
|||
procedure TfrmViewer.cm_ZoomOut(const Params: array of string);
|
||||
begin
|
||||
if miGraphics.Checked then
|
||||
cm_Zoom(['0.9'])
|
||||
ZoomImage(0.9)
|
||||
else
|
||||
begin
|
||||
gFonts[dcfViewer].Size:=gFonts[dcfViewer].Size-1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue