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

lephilousophe noreply at scummvm.org
Sat Sep 5 11:07:38 UTC 2026


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

Summary:
fdbf20cfa7 GRAPHICS: Cast rounded rectangle shadows to the right/bottom only
3a699e75a4 GRAPHICS: Keep a rounded rectangle shadow that ends at the screen edge
4ca5f966db GUI: Make room for the list shadow in the compact launcher
036eb4521d GUI: Make room for the grid shadow in the full-screen launcher
b080be8993 GUI: Restore only the area a widget can draw into


Commit: fdbf20cfa75be3212842f816978e44a8f74dc834
    https://github.com/scummvm/scummvm/commit/fdbf20cfa75be3212842f816978e44a8f74dc834
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-09-05T13:07:32+02:00

Commit Message:
GRAPHICS: Cast rounded rectangle shadows to the right/bottom only

A shadow of N pixels was drawn N pixels to the right, N+1 to the bottom,
and 2 pixels to the left of the widget, so it was neither symmetric nor
cast in one direction. None of the other primitives paints to the left:
squares cast N to the right and to the bottom, circles displace the
whole shape, tabs only reach past the bottom. Rounded rectangles did not
either until 5c00dbbd2ac3.

The comment was explicit about the 2px left edge but I'm unable to find
a good reason to do it that way, nor for the extra row at the bottom,
which it does not mention at all. N is also what the GUI assumes when it
reserves 1+N pixels behind a widget, the 1 being the widget's own edge.

Changed paths:
    graphics/VectorRendererSpec.cpp


diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index ec668830090..7c43ae4c303 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -3744,9 +3744,9 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int offset, uint32
 	uint8 expFactor = 3;
 	uint16 alpha = (_activeSurface->format.bytesPerPixel > 2) ? 4 : 8;
 
-	// These constants ensure a border of 2px on the left and of each rounded square
-	Common::Rect shadowRect(w + offset + 2, h + offset + 1);
-	shadowRect.translate((x1 > 2) ? x1 - 2 : x1, y1);
+	// The shadow is cast down and to the right, by 'offset' pixels on both sides
+	Common::Rect shadowRect(w + offset, h + offset);
+	shadowRect.translate(x1, y1);
 
 	// The rounded rectangle drawn on top of this shadow is guaranteed
 	// to occlude entirely the following rect with a non-transparent color.
@@ -3843,9 +3843,9 @@ drawRoundedSquareShadowClip(int x1, int y1, int r, int w, int h, int offset, uin
 	uint8 expFactor = 3;
 	uint16 alpha = (_activeSurface->format.bytesPerPixel > 2) ? 4 : 8;
 
-	// These constants ensure a border of 2px on the left and of each rounded square
-	Common::Rect shadowRect(w + offset + 2, h + offset + 1);
-	shadowRect.translate((x1 > 2) ? x1 - 2 : x1, y1);
+	// The shadow is cast down and to the right, by 'offset' pixels on both sides
+	Common::Rect shadowRect(w + offset, h + offset);
+	shadowRect.translate(x1, y1);
 
 	// The rounded rectangle drawn on top of this shadow is guaranteed
 	// to occlude entirely the following rect with a non-transparent color.


Commit: 3a699e75a4cf2b956703baf48c2931d014644a44
    https://github.com/scummvm/scummvm/commit/3a699e75a4cf2b956703baf48c2931d014644a44
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-09-05T13:07:32+02:00

Commit Message:
GRAPHICS: Keep a rounded rectangle shadow that ends at the screen edge

Such a shadow was dropped completely, on all four sides, while the GUI
still reserved and restored the space for it. In the compact layout this
is every dialog that fills the screen: the file browser, the game
chooser, the theme browser, the mass add dialog and the options dialog.

The test became one pixel stricter than the drawing needs in
af289bdb03d7, which dropped an x++; y++; w--; h--; from the top of the
function and tightened the test to compensate. Nothing needed
compensating: (x + 1) + (w - 1) is x + w, so the tested quantity never
moved.

Changed paths:
    graphics/VectorRendererSpec.cpp


diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 7c43ae4c303..18b07b097b3 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -1256,8 +1256,8 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
 	bool useOriginal = _clippingArea.contains(Common::Rect(x, y, x + w + 1, y + h + 1));
 
 	if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
-		&& x + w + Base::_shadowOffset + 1 < Base::_activeSurface->w
-		&& y + h + Base::_shadowOffset + 1 < Base::_activeSurface->h
+		&& x + w + Base::_shadowOffset < Base::_activeSurface->w
+		&& y + h + Base::_shadowOffset < Base::_activeSurface->h
 		&& h > (Base::_shadowOffset + 1) * 2) {
 		if (useOriginal) {
 			drawRoundedSquareShadow(x, y, r, w, h, Base::_shadowOffset, Base::_shadowIntensity);


Commit: 4ca5f966db5d9e7adcdfda981c9e58fa0371f8e7
    https://github.com/scummvm/scummvm/commit/4ca5f966db5d9e7adcdfda981c9e58fa0371f8e7
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-09-05T13:07:32+02:00

Commit Message:
GUI: Make room for the list shadow in the compact launcher

Until now the list has no shadow at all: the renderer drops it entirely,
on all four sides, when it does not fit.

One could shrink the shadow itself -- currently it needs 7+0+1 pixels in
both directions. However that would shrink the shadow (to as few as
2px!) for everything which uses widget_default so I think reserving room
in the layouts is a better approach, even if it costs some pixels in
each direction.

This adds +4px below GameList widget as well as +4px before Launcher's
layout's left/right edge. The left one is purely for symmetry reasons.

And it also fixes #14458 (https://bugs.scummvm.org/ticket/14458) which
is how I discovered the missing shadow.

Changed paths:
    gui/themes/common/lowres_layout.stx
    gui/themes/residualvm.zip
    gui/themes/scummmodern.zip
    gui/themes/scummremastered.zip


diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 1ec690bcca1..380386eac9b 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -147,7 +147,7 @@
 	</globals>
 
 	<dialog name = 'Launcher' overlays = 'screen'>
-		<layout type = 'vertical' align = 'center' padding = '4, 4, 2, 2' spacing = '2'>
+		<layout type = 'vertical' align = 'center' padding = '8, 8, 2, 2' spacing = '2'>
 			<layout type = 'horizontal'  spacing = '5' padding = '0, 0, 0, 0'>
 				<widget name = 'HelpButton'
 						height = 'Globals.Button.Height'
@@ -193,7 +193,7 @@
 				/>
 			</layout>
 			<widget name = 'GameList'/>
-			<layout type = 'horizontal' padding = '0, 0, 2, 0' spacing = '2'>
+			<layout type = 'horizontal' padding = '0, 0, 6, 0' spacing = '2'>
 				<widget name = 'LoadGameButton'
 						height = 'Globals.Button.Height'
 				/>
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 40cb2b5bb42..5923803bf1d 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index ec6dcb3cc71..ccc3f51daf2 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index e7352e4e615..8141c3b0771 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ


Commit: 036eb4521d19fe3fe576470444a4810c2faf5521
    https://github.com/scummvm/scummvm/commit/036eb4521d19fe3fe576470444a4810c2faf5521
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-09-05T13:07:32+02:00

Commit Message:
GUI: Make room for the grid shadow in the full-screen launcher

Same cause as the compact layout. It is reproducible e.g. in the grid
view, when a bottom button is hovered and with focus on the search field
with some text typed.

Changed paths:
    gui/themes/common/highres_layout.stx
    gui/themes/residualvm.zip
    gui/themes/scummmodern.zip
    gui/themes/scummremastered.zip


diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 96623302e63..326e8e61471 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -413,7 +413,7 @@
 			<layout type = 'horizontal' padding = '0, 0, 2, 0' spacing = '2'>
 				<widget name = 'IconArea'/>
 			</layout>
-			<layout type = 'horizontal' padding = '0, 0, 2, 0' spacing = '2'>
+			<layout type = 'horizontal' padding = '0, 0, 4, 0' spacing = '2'>
 				<widget name = 'AddGameButton'
 						height = 'Globals.Button.Height'
 				/>
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 5923803bf1d..8cddbcdb26e 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index ccc3f51daf2..9fa94923893 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 8141c3b0771..6e6a1ac4fe1 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ


Commit: b080be8993e6758888c52fb0a37dd9e5c5da37fd
    https://github.com/scummvm/scummvm/commit/b080be8993e6758888c52fb0a37dd9e5c5da37fd
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-09-05T13:07:32+02:00

Commit Message:
GUI: Restore only the area a widget can draw into

The code grows the restored area on all four sides even though nothing
is drawn at the top and to the left. Those pixels belong to the
neighbouring widgets, and restoring them repaints whatever was drawn
there from the background layer.

To the right and at the bottom the pixel stays, for a reason of its own:
the rounded rectangle routines fill w+1 pixels, so a widget paints its
own edge one pixel past its rectangle. With the shadow beyond it that
side needs 1+N, which is what it now says instead of arriving at the
same number through a margin plus a difference of offsets.

It feels tempting to reuse kDirtyRectangleThreshold for that +1 but this
would be misleading. That constant had a confusing life in 2008:

- 96f2d9ca18ee: added as 2, in addDirtyRect(), "to expand dirty
  rectangles, to make sure they are fully copied"

- 4645e706a8c: moved into drawDD(), whose rectangle is both the dirty
  one and the one restored from the back buffer

- 52f3551587a: set to 0, inside a text drawing fix

- 4368e8132f2: set back to 1, no explanation given

and 1 it stayed for eighteen years. addDirtyRect() has long since
stopped growing anything, so the only thing left of the constant was
deciding how much background gets restored, the job it was never
introduced for.

Changed paths:
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index e31c8f42a52..8132caa937f 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -906,11 +906,15 @@ Common::Rect ThemeEngine::getDrawDataExtendedRect(DrawData type, const Common::R
 
 	Common::Rect extendedRect = r;
 	extendedRect.clip(_screen.w, _screen.h);
-	extendedRect.grow(kDirtyRectangleThreshold + drawData->_backgroundOffset);
-	if (drawData->_shadowOffset > drawData->_backgroundOffset) {
-		extendedRect.right += drawData->_shadowOffset - drawData->_backgroundOffset;
-		extendedRect.bottom += drawData->_shadowOffset - drawData->_backgroundOffset;
-	}
+
+	// A frame drawn around the widget extends on all four sides
+	extendedRect.grow(drawData->_backgroundOffset);
+
+	// The drawing primitives paint the widget's own edge one pixel past its
+	// rectangle, and shadows are cast to the right and to the bottom only
+	extendedRect.right += 1 + drawData->_shadowOffset;
+	extendedRect.bottom += 1 + drawData->_shadowOffset;
+
 	return extendedRect;
 }
 
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 75a61fd1f4a..f3dc23c7da0 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -337,9 +337,6 @@ public:
 		kGfxAntialias  ///< Optimized AA renderer.
 	};
 
-	/** Constant value to expand dirty rectangles, to make sure they are fully copied */
-	static const int kDirtyRectangleThreshold = 1;
-
 	struct Renderer {
 		const char *name;
 		const char *shortname;




More information about the Scummvm-git-logs mailing list