Ignore:
Timestamp:
Sep 13, 2024, 8:37:17 PM (2 months ago)
Author:
chronos
Message:
  • Fixed: Scrollbars behave differently on Linux and Windows. Use conditional code to make it work correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r611 r612  
    68626862  trixFocus, uix, uixDefender: Integer;
    68636863  Prio: Boolean;
     6864  RowsCount: Integer;
    68646865begin
    68656866  TroopLoc := Loc;
     
    68896890  else
    68906891  begin
    6891     VerticalScrollBar.Init(Ceil(TrCnt / TrRow), 1);
     6892    {$IFDEF UNIX}
     6893    RowsCount := Ceil(TrCnt / TrRow);
     6894    {$ELSE}
     6895    RowsCount := (TrCnt + TrRow - 1) div TrRow - 1;
     6896    {$ENDIF}
     6897    VerticalScrollBar.Init(RowsCount, 1);
    68926898    if (VerticalScrollBar.Max >= VerticalScrollBar.PageSize) and (trixFocus >= 0) then
    68936899      VerticalScrollBar.Position := trixFocus div TrRow;
Note: See TracChangeset for help on using the changeset viewer.