Ignore:
Timestamp:
Sep 15, 2024, 10:04:45 PM (4 days ago)
Author:
chronos
Message:
  • Modified: Show windows by default on primary screen if multiple monitors present.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/TechTree.pas

    r577 r622  
    214214
    215215  // Fit window to image, center image in window, center window to screen
    216   NewWidth := Min(Screen.Width - 40, Image.Width + LeftBorder + RightBorder +
     216  NewWidth := Min(Screen.PrimaryMonitor.Width - 40, Image.Width + LeftBorder + RightBorder +
    217217    2 * BlackBorder);
    218   NewHeight := Min(Screen.Height - 40, Image.Height + TopBorder + BottomBorder +
     218  NewHeight := Min(Screen.PrimaryMonitor.Height - 40, Image.Height + TopBorder + BottomBorder +
    219219    2 * BlackBorder);
    220   BoundsRect := Bounds((Screen.Width - NewWidth) div 2,
    221     (Screen.Height - NewHeight) div 2, NewWidth, NewHeight);
     220  BoundsRect := Bounds(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - NewWidth) div 2,
     221    Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - NewHeight) div 2, NewWidth, NewHeight);
    222222  CloseBtn.Left := Width - CloseBtn.Width - BlackBorder - 8;
    223223  CloseBtn.Top := BlackBorder + 8;
Note: See TracChangeset for help on using the changeset viewer.