You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to verify that Document->render...() created a valid bitmap. With 3.0, Bitmap::valid() returns false if the bitmap exists whereas previously it returned true. It took me a while to find the problem, and I see that valid() is documented as deprecated but not marked as such. It certainly should not be used in it's current form since the correct check would now be:
if ( !bmp.valid() )
I.e., if valid returns false then the bitmap is valid.
Could this be either reversed back to it's original meaning so it doesn't break existing code, or marked as deprecated so that at least there is a compiler warning when using it?
The text was updated successfully, but these errors were encountered:
Could this be either reversed back to it's original meaning so it doesn't break existing code
I addressed this issue last week in this commit. I will release the patch when the time is right.
It took me a while to find the problem, and I see that valid() is documented as deprecated but not marked as such.
Since the API header is using C++11, I don’t see an easy way to mark the valid() function as [[deprecated]]. Instead, I’ve opted to use Doxygen comment style to indicate its deprecated status.
Having valid() return the same boolean value solves the issue for me, allowing me to switch back and forth between 3.0 and older version of lunasvg while I update all my code using the updated lunasvg. Thanks!
Previously, I used:
if ( bmp.valid() )
to verify that
Document->render...()
created a valid bitmap. With 3.0, Bitmap::valid() returns false if the bitmap exists whereas previously it returned true. It took me a while to find the problem, and I see that valid() is documented as deprecated but not marked as such. It certainly should not be used in it's current form since the correct check would now be:if ( !bmp.valid() )
I.e., if valid returns false then the bitmap is valid.
Could this be either reversed back to it's original meaning so it doesn't break existing code, or marked as deprecated so that at least there is a compiler warning when using it?
The text was updated successfully, but these errors were encountered: