summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-06 12:44:34 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-06 12:44:58 +0300
commit58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc (patch)
treeb9834ce846bcb672ca50384b561480c9c4fcc09e /src/gui/widgets
parent9f74ca8f68db611fe1bfcab6b47892a387bc4ae4 (diff)
downloadmanaplus-58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc.tar.gz
manaplus-58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc.tar.bz2
manaplus-58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc.tar.xz
manaplus-58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc.zip
Add missing check in desktop class.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/desktop.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 455b36554..bee1c76e6 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -88,17 +88,17 @@ void Desktop::draw(gcn::Graphics *graphics)
const gcn::Rectangle &rect = mDimension;
const int width = rect.width;
const int height = rect.height;
- const int wallpWidth = mWallpaper->getWidth();
- const int wallpHeight = mWallpaper->getHeight();
-
- if (!mWallpaper || (width > wallpWidth || height > wallpHeight))
- {
- g->setColor(mBackgroundGrayColor);
- g->fillRectangle(gcn::Rectangle(0, 0, width, height));
- }
-
if (mWallpaper)
{
+ const int wallpWidth = mWallpaper->getWidth();
+ const int wallpHeight = mWallpaper->getHeight();
+
+ if (width > wallpWidth || height > wallpHeight)
+ {
+ g->setColor(mBackgroundGrayColor);
+ g->fillRectangle(gcn::Rectangle(0, 0, width, height));
+ }
+
if (!imageHelper->useOpenGL())
{
g->drawImage(mWallpaper,
@@ -112,6 +112,11 @@ void Desktop::draw(gcn::Graphics *graphics)
width, height, false);
}
}
+ else
+ {
+ g->setColor(mBackgroundGrayColor);
+ g->fillRectangle(gcn::Rectangle(0, 0, width, height));
+ }
// Draw a thin border under the application version...
g->setColor(mBackgroundColor);