Skip to content

Commit

Permalink
C4Viewport: Move GetViewSection out of the Win32-only block
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgen301 committed Nov 17, 2023
1 parent 53a45df commit 905959d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/C4Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,6 @@ bool C4Viewport::ScrollBarsByViewPosition()
return true;
}

C4Section &C4Viewport::GetViewSection()
{
if (C4Player *const plr{Game.Players.Get(Player)}; plr)
{
return *plr->ViewSection.Denumerated();
}

return *Game.Sections.front();
}

#elif defined(WITH_DEVELOPER_MODE)
static GtkTargetEntry drag_drop_entries[] =
{
Expand Down Expand Up @@ -1248,6 +1238,16 @@ void C4Viewport::CenterPosition()
UpdateViewPosition();
}

C4Section &C4Viewport::GetViewSection()
{
if (C4Player *const plr{Game.Players.Get(Player)}; plr)
{
return *plr->ViewSection.Denumerated();
}

return *Game.Sections.front();
}

void C4Viewport::UpdateViewPosition()
{
C4Section &section{GetViewSection()};
Expand Down

0 comments on commit 905959d

Please sign in to comment.