Changeset 610


Ignore:
Timestamp:
Sep 13, 2024, 8:12:07 PM (5 days ago)
Author:
chronos
Message:
  • Fixed: Rows scrolling of high number of units in single map tile.
Location:
trunk/LocalPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/PVSB.pas

    r508 r610  
    5454  Self.Max := Max;
    5555  ScrollBar.Position := 0;
    56   ScrollBar.Visible := Max >= ScrollBar.PageSize;
     56  ScrollBar.Visible := Max > ScrollBar.PageSize;
    5757end;
    5858
  • trunk/LocalPlayer/Term.pas

    r592 r610  
    1212{$ENDIF}
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    14   LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types,
     14  LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types, Math,
    1515  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
     
    315315    Panel: TBitmap;
    316316    TopBar: TBitmap;
    317     VerticalScrollBar: TPVScrollbar;
     317    VerticalScrollBar: TPVScrollBar;
    318318    Closable: Boolean;
    319319    RepaintOnResize: Boolean;
     
    50855085        with MyUn^[UnFocus] do
    50865086        with MyModel^[mix] do
     5087        if (Me >= 0) and (Me < nPl) then
    50875088        begin { display info about selected unit }
    50885089          if Job = jCity then
     
    51685169                  begin
    51695170                    if (Count >= TrRow * VerticalScrollBar.Position) and
    5170                       (Count < TrRow * (VerticalScrollBar.Position + 1)) then
     5171                      (Count < TrRow * (VerticalScrollBar.Position + 1)) and
     5172                      (Me >= 0) and (Me < nPl) then
    51715173                    begin
    51725174                      trix[Count - TrRow * VerticalScrollBar.Position] := uix;
     
    68866888  else
    68876889  begin
    6888     VerticalScrollBar.Init((TrCnt + TrRow - 1) div TrRow - 1, 1);
     6890    VerticalScrollBar.Init(Ceil(TrCnt / TrRow), 1);
    68896891    if (VerticalScrollBar.Max >= VerticalScrollBar.PageSize) and (trixFocus >= 0) then
    68906892      VerticalScrollBar.Position := trixFocus div TrRow;
     
    84158417procedure TMainScreen.ScrollBarUpdate(Sender: TObject);
    84168418begin
     8419  {$IFDEF UNIX}
     8420  // Do not scroll with mouse wheel to and above max value
     8421  if VerticalScrollBar.Position > VerticalScrollBar.Max - 1 then
     8422    VerticalScrollBar.Position := VerticalScrollBar.Max - 1;
     8423  {$ENDIF}
    84178424  PanelPaint;
    84188425  Update;
Note: See TracChangeset for help on using the changeset viewer.