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

lephilousophe lephilousophe at users.noreply.github.com
Sun Jun 20 09:48:39 UTC 2021


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

Summary:
66c78dc25a GRAPHICS: Ensure we still have space to draw the shadow
e62e9e84d5 GUI: Don't draw text when the rect planned for it is too small


Commit: 66c78dc25ac68b9a0a5f8fed821e54496127f438
    https://github.com/scummvm/scummvm/commit/66c78dc25ac68b9a0a5f8fed821e54496127f438
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-06-20T11:48:19+02:00

Commit Message:
GRAPHICS: Ensure we still have space to draw the shadow

Else we get ptr_tl and ptr_tr reversed which causes bugs when filling
pixels

Changed paths:
    graphics/VectorRendererSpec.cpp


diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index fcd3cc63ab..682c1c1ba4 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -3171,6 +3171,12 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int offset) {
 		int f, ddF_x, ddF_y;
 		int x, y, px, py;
 
+		// No more room to draw: abort
+		if ((shadowRect.width() < 2*r) ||
+			(shadowRect.height() < 2*r)) {
+			break;
+		}
+
 		PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(shadowRect.left  + r, shadowRect.top + r);
 		PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(shadowRect.right - r, shadowRect.top + r);
 		PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(shadowRect.left  + r, shadowRect.bottom - r);


Commit: e62e9e84d58d5b4086e6921c0a0b13f4343b7894
    https://github.com/scummvm/scummvm/commit/e62e9e84d58d5b4086e6921c0a0b13f4343b7894
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-06-20T11:48:19+02:00

Commit Message:
GUI: Don't draw text when the rect planned for it is too small

Rect is not valid anymore and we get assertion failures

Changed paths:
    gui/ThemeEngine.cpp


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 486e5b3245..8ec8ac4b26 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1066,6 +1066,12 @@ void ThemeEngine::drawDropDownButton(const Common::Rect &r, uint32 dropdownWidth
 	Common::Rect textRect = r;
 	textRect.left  = r.left  + dropdownWidth;
 	textRect.right = r.right - dropdownWidth;
+
+	// Don't draw text if we don't have enough room for it
+	if (!textRect.isValidRect()) {
+		return;
+	}
+
 	drawDDText(getTextData(dd), getTextColor(dd), textRect, str, false, true, convertTextAlignH(_widgets[dd]->_textAlignH, rtl),
 	           _widgets[dd]->_textAlignV);
 }




More information about the Scummvm-git-logs mailing list