Fix assert failing when drawing an image with empty source bounds

This commit is contained in:
David Capello 2023-01-12 16:20:53 -03:00
parent c910efe2f4
commit 705cc3af50

View File

@ -53,6 +53,9 @@ void GraphicsContext::drawImage(const doc::Image* img,
const gfx::Rect& srcRc,
const gfx::Rect& dstRc)
{
if (srcRc.isEmpty() || dstRc.isEmpty())
return; // Do nothing for empty rectangles
auto tmpSurface = os::instance()->makeRgbaSurface(srcRc.w, srcRc.h);
if (tmpSurface) {
convert_image_to_surface(