From 58ccd6f9619f84e8e87ca9c6c7cd6f8bc01e7bfc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Jun 2013 12:44:34 +0300 Subject: Add missing check in desktop class. --- src/gui/widgets/desktop.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/gui/widgets/desktop.cpp') 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); -- cgit v1.2.3-70-g09d2