summaryrefslogtreecommitdiff
path: root/src/gui/widgets/icon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/icon.cpp')
-rw-r--r--src/gui/widgets/icon.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index 1d5de684d..4be9ae127 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -82,3 +82,15 @@ void Icon::draw(Graphics *graphics)
}
BLOCK_END("Icon::draw")
}
+
+void Icon::safeDraw(Graphics *graphics)
+{
+ BLOCK_START("Icon::draw")
+ if (mImage)
+ {
+ graphics->drawImage(mImage,
+ (mDimension.width - mImage->mBounds.w) / 2,
+ (mDimension.height - mImage->mBounds.h) / 2);
+ }
+ BLOCK_END("Icon::draw")
+}