Skip to content

s25edit backports from s25client - #37

Open
morganchristiansson wants to merge 7 commits into
Return-To-The-Roots:masterfrom
morganchristiansson:resize-window
Open

morganchristiansson wants to merge 7 commits into
Return-To-The-Roots:masterfrom
morganchristiansson:resize-window

Conversation

@morganchristiansson

@morganchristiansson morganchristiansson commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor
  • Allow window resizing split to Allow window resizing #46
  • Fix segfault with small map&large screen
  • Fix black area with small map&large screen
  • Fix mouse panning on Linux
  • Zoom with mouse wheel

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, that definitely improves it!
Some notes inline, a common theme is that any pair of x/y or width/height values should use either Point/PointF or Extent which avoids C&P errors and makes processing easier (single assignment instead of 2, operator support for combining with other Points)
Note: In some places fixed-size variants are used. That is historical and not necessary in almost all cases, so no need to introduce new uses of them unless there is a specific reason for the size requirement.

Thanks again!

Comment thread CMap.cpp Resolved
Comment thread CMap.cpp Resolved
Comment thread CMap.cpp Resolved
Comment thread CGame_Event.cpp Resolved
Comment thread CGame_Event.cpp Resolved
Comment thread CGame_Event.cpp Resolved
Comment thread CGame_Event.cpp Resolved
Comment thread CGame_Init.cpp Resolved
Comment thread CGame_Init.cpp Resolved
Comment thread CMap.cpp Resolved
@morganchristiansson

Copy link
Copy Markdown
Contributor Author

Maybe I should split this into smaller PRs.

I was working on import heightmap as I posted about on Discord, not sure I will submit as PR. And these were some quality of life improvements that felt important.

@morganchristiansson

Copy link
Copy Markdown
Contributor Author

What's the holdup here? All review comments are resolved.

@Flow86

Flow86 commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

What's the holdup here? All review comments are resolved.

life ;-)

oh and there is a conflict

@morganchristiansson

Copy link
Copy Markdown
Contributor Author

Ah ok no worries then. I'm just impatient lol.
There's no conflicts? All green.
I based other branches on this one and can't submit them for PRs until this one is merged. Mainly my s25edit OpenGL branch which would be super nice to get in for review it makes a huge difference.

@morganchristiansson

Copy link
Copy Markdown
Contributor Author

In every branch I work on I'm frustrated by the lack of the Fix mouse panning commit that's in this PR.

@Flamefire

Copy link
Copy Markdown
Member

oh and there is a conflict

@morganchristiansson

Copy link
Copy Markdown
Contributor Author

I went all in on rebase. Squashed some commits with feedback into original commit, removed the commit that was reverted and extracted.
There were conflicts from master.
Please give it another review pass. Hope it's cleaner now tho.

Comment thread CGame_Event.cpp Resolved
@morganchristiansson

Copy link
Copy Markdown
Contributor Author

Also renamed commit "Wrap mouse for large screens" ->"Wrap brush for large screens", as it refers to the icons drawn on vertices not the cursor itself.
And re-ordered height, width to width height to match x, y order. Confusing otherwise.

Comment thread CMap.cpp Resolved

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but a conflict in 74d768d after merge of #52

I think the commit can just be dropped, but please check

@littleant

littleant commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

I rebased this onto current master to resolve the conflicts. The result is here: https://github.com/littleant/s25edit/tree/pr37-rebased

Changes compared to your branch:

  • Dropped "Fix segfault when panning map", as Flamefire suggested. Since OpenGL UI components #52 the minimap window draws itself, and the WndSurface/CALL_FROM_GAMELOOP code this commit fixed no longer exists.
  • "Zoom with mouse wheel" conflicted with the select box wheel scrolling from Add a scrollbar and mouse wheel scrolling to select boxes #65. I resolved it the same way clicks are delivered: the wheel goes to the window under the cursor first, then zooms the map if it's active, and otherwise goes to the menus.
  • "Fix mouse panning": Position::Invalid() → Position::invalid(), because master now uses the lowerCamelCase API of s25client.

Everything else is unchanged, and the commits still have morganchristiansson as the author. It builds on Linux and Windows without warnings, and clang-format is clean.

To update this PR:

git fetch https://github.com/littleant/s25edit pr37-rebased
git checkout resize-window
git reset --hard FETCH_HEAD
git push --force-with-lease

@morganchristiansson please update this PR so Flamefire can merge it. I cannot do this myself. I'm already working on improvements and prefer to build on your work to add the zoom-feature for high-dpi displays. Thanks and sorry for being so pushy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants