Fix bug in drawing sample when using wxGC to draw on a scrolled window (PR #25877)

30 views
Skip to first unread message

AliKet

unread,
Oct 12, 2025, 7:06:54 PM (4 days ago) Oct 12
to wx-...@googlegroups.com, Subscribed

A clip region set using SetDeviceClippingRegion() on a DC should not scroll when the canvas we are drawing on scrolls. The drawing sample behaves like this if the DC is a wxDC instance but not if it is a wxGC instance (because it is not properly prepared when the canvas is scrolled, i.e.: GetDeviceOrigin() always returns (0, 0) for a wxGC). So this bug should be fixed by preparing the correct DC that we are actually using for drawing.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25877

Commit Summary

  • c265590 Fix bug in drawing sample when using wxGC to draw on a scrolled window

File Changes

(1 file)

Patch Links:


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/pull/25877@github.com>

RobertRoeb

unread,
Oct 13, 2025, 12:33:34 AM (4 days ago) Oct 13
to wx-...@googlegroups.com, Subscribed
RobertRoeb left a comment (wxWidgets/wxWidgets#25877)

Do the different ports behave the same then? I remember you reported a platform difference initially


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/pull/25877/c3395824735@github.com>

AliKet

unread,
Oct 13, 2025, 8:01:55 AM (4 days ago) Oct 13
to wx-...@googlegroups.com, Subscribed
AliKet left a comment (wxWidgets/wxWidgets#25877)

Do the different ports behave the same then?

Yes, but we should pass the wxGC to PrepareDC() and not the original wxDC for things to work properly.


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/pull/25877/c3397232993@github.com>

VZ

unread,
Oct 14, 2025, 6:48:16 AM (3 days ago) Oct 14
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25877)

Thanks, I'm not quite sure that there is no other bug here, i.e. I'd expect preparing (= shifting origin) of the wxDC to be inherited by wxGC too and this doesn't seem to happen, but preparing wxGC itself should definitely work in any case, so the new code is definitely correct.

Will push in a moment, thanks again.


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/pull/25877/c3401205202@github.com>

VZ

unread,
Oct 14, 2025, 6:48:27 AM (3 days ago) Oct 14
to wx-...@googlegroups.com, Subscribed

Closed #25877 via 0135b80.


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/pull/25877/issue_event/20266643525@github.com>

Reply all
Reply to author
Forward
0 new messages