diff options
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r-- | gui/widget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 9297cce344..14cb61006b 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -583,6 +583,11 @@ void GraphicsWidget::setGfx(const Graphics::Surface *gfx) { if (!gfx || !gfx->pixels) return; + if (gfx->w > _w || gfx->h > _h) { + warning("GraphicsWidget has size %dx%d, but a surface with %dx%d is to be set", _w, _h, gfx->w, gfx->h); + return; + } + // TODO: add conversion to OverlayColor _gfx.copyFrom(*gfx); } |