[Scummvm-git-logs] scummvm master -> 334801ca9ee10a8c7c26d3a5dedd62017ebf1f23

lephilousophe noreply at scummvm.org
Sat Apr 25 16:34:52 UTC 2026


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

Summary:
092c725701 GUI: Make swapClipRect in widgets more robust
334801ca9e GUI: Add override keywords to TextViewerDialog


Commit: 092c7257011c395780ce6acb5fcb557a01d3c6ff
    https://github.com/scummvm/scummvm/commit/092c7257011c395780ce6acb5fcb557a01d3c6ff
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-25T18:15:29+02:00

Commit Message:
GUI: Make swapClipRect in widgets more robust

Always restore the clip rect if we modified it.
Also only swap it once.

Changed paths:
    gui/widget.cpp


diff --git a/gui/widget.cpp b/gui/widget.cpp
index 6b4d7c76d18..7ba6e13d39c 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -99,7 +99,8 @@ void Widget::draw() {
 	if (!isVisible() || !_boss->isVisible())
 		return;
 
-	if (_needsRedraw) {
+	bool needsRedraw = _needsRedraw;
+	if (needsRedraw) {
 		int oldX = _x, oldY = _y;
 
 		// Account for our relative position in the dialog
@@ -108,14 +109,11 @@ void Widget::draw() {
 
 		Common::Rect activeRect = g_gui.theme()->getClipRect();
 		Common::Rect clip = _boss->getClipRect().findIntersectingRect(activeRect);
-		oldClip = g_gui.theme()->swapClipRect(clip);
-
 		if (g_gui.useRTL()) {
 			_x = g_system->getOverlayWidth() - _x - _w;
-
 			clip.moveTo(_x, clip.top);
-			g_gui.theme()->swapClipRect(clip);
 		}
+		oldClip = g_gui.theme()->swapClipRect(clip);
 
 		// Draw border
 		if (_flags & WIDGET_BORDER) {
@@ -151,7 +149,7 @@ void Widget::draw() {
 		w->draw();
 		w = w->_next;
 	}
-	if (!oldClip.isEmpty()) {
+	if (needsRedraw) {
 		g_gui.theme()->swapClipRect(oldClip);
 	}
 }


Commit: 334801ca9ee10a8c7c26d3a5dedd62017ebf1f23
    https://github.com/scummvm/scummvm/commit/334801ca9ee10a8c7c26d3a5dedd62017ebf1f23
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-25T18:34:24+02:00

Commit Message:
GUI: Add override keywords to TextViewerDialog

Changed paths:
    gui/textviewer.h


diff --git a/gui/textviewer.h b/gui/textviewer.h
index d08026010e0..3c3ddd9ecaa 100644
--- a/gui/textviewer.h
+++ b/gui/textviewer.h
@@ -64,19 +64,19 @@ private:
 	const Graphics::Font *_font = nullptr;
 
 	bool loadFile(const Common::Path &fname);
-	void reflowLayout();
+	void reflowLayout() override;
 
 public:
 	TextViewerDialog(const Common::Path &fname);
 	~TextViewerDialog();
 
 	void destroy();
-	void open();
-	void drawDialog(DrawLayer layerToDraw);
+	void open() override;
+	void drawDialog(DrawLayer layerToDraw) override;
 
-	void handleMouseWheel(int x, int y, int direction);
-	void handleKeyDown(Common::KeyState state);
-	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+	void handleMouseWheel(int x, int y, int direction) override;
+	void handleKeyDown(Common::KeyState state) override;
+	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
 };
 
 } // End of namespace GUI




More information about the Scummvm-git-logs mailing list