Maelstrom: The dialog border is outside the area of the dialog itself.

https://github.com/libsdl-org/Maelstrom/commit/be76d45a68bdb7f366c97195a83b6b4eaf75fa7f

From be76d45a68bdb7f366c97195a83b6b4eaf75fa7f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 28 Oct 2011 01:02:52 -0400
Subject: [PATCH] The dialog border is outside the area of the dialog itself.

---
 UI/dawn.xml  |  6 +++---
 UIDialog.cpp | 10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/UI/dawn.xml b/UI/dawn.xml
index ad4891d3..96f0e14f 100644
--- a/UI/dawn.xml
+++ b/UI/dawn.xml
@@ -1,9 +1,9 @@
 <Dialog>
-	<Size w="318" h="194"/>
-	<Anchor anchorFrom="TOPLEFT" anchorTo="TOPLEFT" x="160" y="73"/>
+	<Size w="310" h="186"/>
+	<Anchor anchorFrom="TOPLEFT" anchorTo="TOPLEFT" x="164" y="77"/>
 	<Elements>
 		<Icon name="icon" id="103">
-			<Anchor anchorFrom="TOPLEFT" anchorTo="TOPLEFT" x="23" y="23"/>
+			<Anchor anchorFrom="TOPLEFT" anchorTo="TOPLEFT" x="19" y="19"/>
 		</Icon>
 		<Label name="line1" template="Dialog" text="No eternal reward will forgive us">
 			<Anchor anchorFrom="TOPLEFT" anchorTo="TOPRIGHT" anchor="icon" x="25"/>
diff --git a/UIDialog.cpp b/UIDialog.cpp
index 16ef73a1..a6b67147 100644
--- a/UIDialog.cpp
+++ b/UIDialog.cpp
@@ -63,8 +63,8 @@ UIDialog::Draw()
 	int maxx, maxy;
 
 	if (m_step < EXPAND_STEPS) {
-		w = 8+((m_rect.w-8)*m_step)/EXPAND_STEPS;
-		h = 8+((m_rect.h-8)*m_step)/EXPAND_STEPS;
+		w = (m_rect.w*m_step)/EXPAND_STEPS;
+		h = (m_rect.h*m_step)/EXPAND_STEPS;
 		x = m_rect.x + m_rect.w/2 - (w/2);
 		y = m_rect.y + m_rect.h/2 - (h/2);
 	} else {
@@ -73,6 +73,12 @@ UIDialog::Draw()
 		x = m_rect.x;
 		y = m_rect.y;
 	}
+
+	/* The border is 4 pixels around the area of the dialog */
+	w += 8;
+	h += 8;
+	x -= 4;
+	y -= 4;
 	maxx = x+w-1;
 	maxy = y+h-1;