Changeset 68 for trunk/Forms


Ignore:
Timestamp:
Nov 28, 2020, 12:17:21 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Canvas width and height is not updated correctly on Windows. Use additional CanvasSize parameter in drawing methods.
  • Fixed: Fullscreen was not working on Windows. Form border was not hidden.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r66 r68  
    7575  if not Initialized then begin
    7676    Initialized := True;
     77    PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
     78    PersistentForm1.Load(Self, False, True);
     79    FullScreen := PersistentForm1.FormFullScreen;
     80    Randomize;
     81    Engine.InitMenus;
     82    Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture);
     83    Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture);
     84    Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height);
     85    Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
     86    Engine.MainMenu;
    7787  end;
    7888end;
     
    111121procedure TFormMain.FormShow(Sender: TObject);
    112122begin
    113   PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
    114   PersistentForm1.Load(Self, False, True);
    115   FullScreen := PersistentForm1.FormFullScreen;
    116   Randomize;
    117   Engine.InitMenus;
    118   Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture);
    119   Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture);
    120   Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height);
    121   Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
    122   Engine.MainMenu;
    123123end;
    124124
     
    156156begin
    157157  Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
    158   Engine.Paint(PaintBox1.Canvas);
     158  Engine.Paint(PaintBox1.Canvas, Point(PaintBox1.Width, PaintBox1.Height));
    159159end;
    160160
Note: See TracChangeset for help on using the changeset viewer.