diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-28 00:02:01 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-28 00:28:45 +0100 |
commit | e083abd148c70982a098d3f2fff8e61eee5c4f91 (patch) | |
tree | ad375c5c635e5b45f5d79558bc716e9a4165c741 /src/gui/minimap.cpp | |
parent | a96ad66d345807d6021f28c9b05b02328f76cc0f (diff) | |
download | mana-e083abd148c70982a098d3f2fff8e61eee5c4f91.tar.gz mana-e083abd148c70982a098d3f2fff8e61eee5c4f91.tar.bz2 mana-e083abd148c70982a098d3f2fff8e61eee5c4f91.tar.xz mana-e083abd148c70982a098d3f2fff8e61eee5c4f91.zip |
Removed a lot of useless isVisible() checks
The draw() method of a widget isn't called when a widget is not visible.
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 6bca796d..75ee7e3d 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -92,21 +92,14 @@ void Minimap::setMapImage(Image *img) void Minimap::toggle() { - mShow = !mShow; + mShow = ! isVisible(); + setVisible(mShow); } void Minimap::draw(gcn::Graphics *graphics) { - setVisible(mShow); - - if (!isVisible()) - return; - Window::draw(graphics); - if (!mShow) - return; - const gcn::Rectangle a = getChildrenArea(); graphics->pushClipArea(a); |