https://github.com/wxWidgets/wxWidgets/pull/25860
(8 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@vadz commented on this pull request.
> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y) bool wxRegionGeneric::IsEmpty() const { - wxASSERT(m_refData); + if ( m_refData == nullptr )
Do we really want to do this? I think invalid and empty regions are not the same thing, just as transparent and invalid pens/brushes, for example.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@csomor commented on this pull request.
> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y) bool wxRegionGeneric::IsEmpty() const { - wxASSERT(m_refData); + if ( m_refData == nullptr )
Sorry, I wrote this twice as I've somehow managed to loose a set of commits, the reason behind it is the documented behavior:
https://docs.wxwidgets.org/3.3/classwx_region.html#a1edc6768118cf02749b46774a0ca37f9
a freshly created wxRegion is invalid but also empty
and apparently other platforms behave like this, already, I just ran into an assertion when setting the background color on a wxFrame on iOS, which doesn't have a native region class.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@vadz commented on this pull request.
> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y) bool wxRegionGeneric::IsEmpty() const { - wxASSERT(m_refData); + if ( m_refData == nullptr )
Ha, I had even added this comment to the docs myself back in dd4eefc (Document and test behaviour of wxRegion methods when it is invalid., 2011-10-18) but, of course, completely forgot about it. And, as the commit says, there is even a unit test ("wxRegion::Validity") checking for this, so this would have been discovered if we ran unit tests under iOS...
Anyhow, sorry, for not checking this first.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@csomor commented on this pull request.
> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y) bool wxRegionGeneric::IsEmpty() const { - wxASSERT(m_refData); + if ( m_refData == nullptr )
no problem, I really appreciate you looking at things closely
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.