Changeset 707 for trunk/Start.pas


Ignore:
Timestamp:
Aug 19, 2025, 9:36:23 PM (31 hours ago)
Author:
chronos
Message:
  • Fixed: Better start screen location calculation for lower than 800x600 resolutions to make visible entire window.
  • Fixed: Memory overflow in minimap drawing with some higher DPI settings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r685 r707  
    55
    66uses
    7   GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types,
    8   LCLIntf, LCLType, SysUtils, Classes, BaseWin, ListBoxEx, LazFileUtils,
     7  GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area,
     8  LCLIntf, LCLType, SysUtils, Classes, BaseWin, ListBoxEx, LazFileUtils, Math,
    99  Registry, DrawDlg, Generics.Collections, Protocol, MiniMap, Brain, Translator,
    1010  {$IFDEF DPI}System.UITypes, Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls,
     
    520520  r0, r1: HRgn;
    521521  Location: TPoint;
     522  Shift: TPoint;
    522523begin
    523524  if FullScreen then begin
    524     Location := Point(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - 800) * 3 div 8,
    525       Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - Height - (Screen.PrimaryMonitor.Height - 600) div 3);
     525    Shift := Point(((Screen.PrimaryMonitor.Width - Min(Screen.PrimaryMonitor.Width, 800)) * 3 div 8),
     526      (Screen.PrimaryMonitor.Height - Min(Screen.PrimaryMonitor.Height, 600)) div 3);
     527    Location := Point(Screen.PrimaryMonitor.Left + Shift.X,
     528      Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - Height - Shift.Y);
    526529    BoundsRect := Bounds(Location.X, Location.Y, Width, Height);
    527530
Note: See TracChangeset for help on using the changeset viewer.