Maelstrom: Support checkboxes that have both text and images

https://github.com/libsdl-org/Maelstrom/commit/4fd348fc2c2422a18aaa3bf09b0a4931d6075913

From 4fd348fc2c2422a18aaa3bf09b0a4931d6075913 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 17 Nov 2012 23:34:43 -0800
Subject: [PATCH] Support checkboxes that have both text and images

---
 screenlib/UIElementCheckbox.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/screenlib/UIElementCheckbox.cpp b/screenlib/UIElementCheckbox.cpp
index 9aa461d4..9e0e9be9 100644
--- a/screenlib/UIElementCheckbox.cpp
+++ b/screenlib/UIElementCheckbox.cpp
@@ -81,14 +81,20 @@ UIElementCheckbox::FinishLoading()
 	// Extend the sensitive area to encompass the label
 	if (!m_textArea.IsEmpty()) {
 		if (m_textArea.X() >= X()) {
-			SetWidth((m_textArea.X()+m_textArea.Width()) - X());
+			int width = ((m_textArea.X()+m_textArea.Width()) - X());
+			if (width > Width()) {
+				SetWidth(width);
+			}
 		} else {
 			assert(!"Need code for labels on the left");
 		}
 	}
 	if (!m_imageArea.IsEmpty()) {
 		if (m_imageArea.X() >= X()) {
-			SetWidth((m_imageArea.X()+m_imageArea.Width()) - X());
+			int width = ((m_imageArea.X()+m_imageArea.Width()) - X());
+			if (width > Width()) {
+				SetWidth(width);
+			}
 		} else {
 			assert(!"Need code for images on the left");
 		}