wxGridBagSizer item clipping when vgap/hgap are different and some items span multiple rows/cols (Issue #24550)

17 views
Skip to first unread message

dsa-t

unread,
May 22, 2024, 10:45:12 AMMay 22
to wx-...@googlegroups.com, Subscribed

Description

If:

  • vgap and hgap are different in wxGridBagSizer
  • It has items spanning multiple rows (buttons in the example)

then row heights are not calculated correctly, clipping the buttons:
image.png (view on web)

If the hgap is set to 0, equal to vgap, it looks normal:
image.png (view on web)

wxFormBuilder 4.1.0 project: manager_icons.fbp.txt
Merged cpp+header file: noname.cpp.txt


Looks like these lines are wrong:

https://github.com/wxWidgets/wxWidgets/blob/7d47bc0e71558d5edff51203f98b5baab310d08b/src/common/gbsizer.cpp#L605

https://github.com/wxWidgets/wxWidgets/blob/7d47bc0e71558d5edff51203f98b5baab310d08b/src/common/gbsizer.cpp#L644

Platform and version information

  • wxWidgets version you use: 3.2.4
  • wxWidgets port you use: wxMSW
  • OS and its version: Windows 11


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24550@github.com>

VZ

unread,
May 23, 2024, 2:22:12 PMMay 23
to wx-...@googlegroups.com, Subscribed

So is the problem fixed by exchanging the H and V gaps (I don't know this code at all but it would seem to be more logical to subtract vertical gap from the height and horizontal gap from the width rather than vice versa)?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24550/2127781572@github.com>

dsa-t

unread,
May 23, 2024, 3:01:28 PMMay 23
to wx-...@googlegroups.com, Subscribed

Yes, it does seem to fix the issue:

image.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24550/2127840147@github.com>

VZ

unread,
May 23, 2024, 5:32:49 PMMay 23
to wx-...@googlegroups.com, Subscribed

Thanks for testing, will push the fix soon.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24550/2128053122@github.com>

VZ

unread,
May 23, 2024, 5:35:43 PMMay 23
to wx-...@googlegroups.com, Subscribed

Closed #24550 as completed via b4c3bcd.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/24550/issue_event/12915464761@github.com>

Reply all
Reply to author
Forward
0 new messages