Ignore:
Timestamp:
Nov 15, 2014, 10:32:26 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Allow map movement by mouse after moving cursor for at least defined number of pixels to minimalize accidental map move by clicking to map.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r86 r87  
    1111const
    1212  ZoomFactor = 1.5;
     13  MouseMinDiff = 6;
    1314
    1415type
     
    99100    MoveActive: Boolean;
    100101    RedrawPending: Boolean;
     102    Drawing: Boolean;
    101103    DrawDuration: TDateTime;
    102104    LastTimerTime: TDateTime;
     
    162164  NewCaption: string;
    163165begin
    164   if RedrawPending then begin
     166  if RedrawPending and not Drawing then begin
     167    Drawing := True;
    165168    if not Core.DevelMode then RedrawPending := False;
    166169    TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10;
     
    173176      NewCaption := Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption;
    174177    Caption := NewCaption;
     178    Drawing := False;
    175179  end;
    176180end;
     
    221225begin
    222226  {$IFDEF Linux}
    223   PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque];
     227  //PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque];
    224228  {$ENDIF}
    225229  //DoubleBuffered := True;
     
    355359  if Assigned(Core.Game.CurrentPlayer) then begin
    356360    if MoveActive then
     361    if (Abs(StartMousePoint.X - X) > MouseMinDiff) or (Abs(StartMousePoint.Y - Y) > MouseMinDiff) then
    357362    with Core.Game.CurrentPlayer do begin
    358363      if Mode = pmHuman then begin
     
    384389procedure TFormMain.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    385390  Shift: TShiftState; X, Y: Integer);
    386 const
    387   MouseMinDiff = 10;
    388391begin
    389392  if (Abs(StartMousePoint.X - X) < MouseMinDiff) and (Abs(StartMousePoint.Y - Y) < MouseMinDiff) then begin
Note: See TracChangeset for help on using the changeset viewer.