Changeset 245 for trunk/Forms


Ignore:
Timestamp:
Sep 22, 2018, 1:07:53 PM (6 years ago)
Author:
chronos
Message:
  • Added: Limit minimum and maximum map zoom.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r241 r245  
    77  ClientHeight = 621
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1717  object StatusBar1: TStatusBar
    1818    Left = 0
    19     Height = 28
    20     Top = 593
     19    Height = 30
     20    Top = 591
    2121    Width = 775
    2222    Panels = <   
     
    3434  object ToolBar1: TToolBar
    3535    Left = 0
    36     Height = 593
     36    Height = 591
    3737    Top = 0
    3838    Width = 32
     
    8080  object PaintBox1: TPaintBox
    8181    Left = 32
    82     Height = 593
     82    Height = 591
    8383    Top = 0
    8484    Width = 743
  • trunk/Forms/UFormClient.pas

    r243 r245  
    1212const
    1313  ZoomFactor = 1.5;
     14  MinZoom = 0.05;
     15  MaxZoom = 10;
    1416  MouseMinDiff = 0.1;
    1517
     
    447449begin
    448450  with Client do begin
    449     View.Zoom := View.Zoom * ZoomFactor;
     451    if View.Zoom * ZoomFactor < MaxZoom then
     452      View.Zoom := View.Zoom * ZoomFactor;
    450453  end;
    451454  Redraw;
     
    453456
    454457procedure TFormClient.AZoomOutExecute(Sender: TObject);
    455 //var
    456 //  D: TPoint;
    457458begin
    458459  with Client do begin
    459     //D := Point(Trunc(MousePos.X - View.Left / ViewZoom),
    460     //  Trunc(MousePos.Y - View.Top / ViewZoom));
    461     View.Zoom := View.Zoom / ZoomFactor;
    462     //View := Bounds(Trunc((D.X - MousePos.X) * ViewZoom),
    463     //  Trunc((D.Y - MousePos.Y) * ViewZoom),
    464     //  View.Right - View.Left,
    465     //  View.Bottom - View.Top);
     460    if View.Zoom / ZoomFactor > MinZoom then
     461      View.Zoom := View.Zoom / ZoomFactor;
    466462  end;
    467463  Redraw;
  • trunk/Forms/UFormHelp.pas

    r243 r245  
    5252    'In case of tie, defender wins. Loser lose its unit and another pair of dices is evaluated. ' +
    5353    'This process is calculated automatically and for each planned attack win ' +
    54     'probability is displayed.';
     54    'probability is displayed.' +
     55    LineEnding + LineEnding +
     56    'Units can be moved by clicking on owned cell and then by clicking on target neutral ' +
     57    'or enemy cell. Moves can be set to be repeated every turn with defined number of units. ' +
     58    'Repeated unit moves can be set in Unit move dialog or simply by holding Control key while selecting target cell. ' +
     59    'If there are multiple unit moves from one cell to more other cells and ' +
     60    'you want to move all available cells to target cell, then you can do so by holding Shift key while selecting target cell.';
    5561
    5662{$R *.lfm}
Note: See TracChangeset for help on using the changeset viewer.