[Scummvm-git-logs] scummvm master -> a99f7a1ddb00b44a4387db9096c30c776a40e80c

OMGPizzaGuy 48367439+OMGPizzaGuy at users.noreply.github.com
Tue Aug 25 01:12:12 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a99f7a1ddb ULTIMA8: Adjust gump / screen space tranforms once more to ensure zero width and height stay at zero


Commit: a99f7a1ddb00b44a4387db9096c30c776a40e80c
    https://github.com/scummvm/scummvm/commit/a99f7a1ddb00b44a4387db9096c30c776a40e80c
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2020-08-24T20:11:53-05:00

Commit Message:
ULTIMA8: Adjust gump / screen space tranforms once more to ensure zero width and height stay at zero

Changed paths:
    engines/ultima/ultima8/gumps/gump.cpp


diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp
index 8a1e15ad01..657406822b 100644
--- a/engines/ultima/ultima8/gumps/gump.cpp
+++ b/engines/ultima/ultima8/gumps/gump.cpp
@@ -475,10 +475,11 @@ void Gump::GumpRectToScreenSpace(Rect &gr, RectRoundDir r) {
 	int32 x2 = gr.right, y2 = gr.bottom;
 	GumpToScreenSpace(x1, y1, tl);
 	GumpToScreenSpace(x2, y2, br);
-	gr.left = x1;
-	gr.top = y1;
-	gr.right = x2;
-	gr.bottom = y2;
+	gr.moveTo(x1, y1);
+	if (gr.width() != 0)
+		gr.setWidth(x2 - x1);
+	if (gr.height() != 0)
+		gr.setHeight(y2 - y1);
 }
 
 // Transform a rectangle to gumpspace from screenspace
@@ -490,10 +491,11 @@ void Gump::ScreenSpaceToGumpRect(Rect &sr, RectRoundDir r) {
 	int32 x2 = sr.right, y2 = sr.bottom;
 	ScreenSpaceToGump(x1, y1, tl);
 	ScreenSpaceToGump(x2, y2, br);
-	sr.left = x1;
-	sr.top = y1;
-	sr.right = x2;
-	sr.bottom = y2;
+	sr.moveTo(x1, y1);
+	if (sr.width() != 0)
+		sr.setWidth(x2 - x1);
+	if (sr.height() != 0)
+		sr.setHeight(y2 - y1);
 }
 
 uint16 Gump::TraceObjId(int32 mx, int32 my) {




More information about the Scummvm-git-logs mailing list