[Scummvm-git-logs] scummvm master -> 5b10353a688ce2f93321546f98eda7650498b6e3

sev- noreply at scummvm.org
Thu Mar 14 17:59:21 UTC 2024


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:
5b10353a68 GUI: Implement Window border draggability


Commit: 5b10353a688ce2f93321546f98eda7650498b6e3
    https://github.com/scummvm/scummvm/commit/5b10353a688ce2f93321546f98eda7650498b6e3
Author: Nabeel Khan (i210443 at nu.edu.pk)
Date: 2024-03-14T18:59:16+01:00

Commit Message:
GUI: Implement Window border draggability

Changed paths:
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindowborder.cpp


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 0edb06e4f60..570abcaf0b2 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -263,6 +263,8 @@ void MacWindow::updateOuterDims() {
 }
 
 void MacWindow::drawBorder() {
+	resizeBorderSurface();
+
 	_borderIsDirty = false;
 
 	ManagedSurface *g = &_borderSurface;
@@ -365,8 +367,11 @@ void MacWindow::setBorder(Graphics::ManagedSurface *surface, uint32 flags, Borde
 
 void MacWindow::resizeBorderSurface() {
 	updateOuterDims();
-	_borderSurface.free();
-	_borderSurface.create(_dims.width(), _dims.height(), _wm->_pixelformat);
+
+	if (_borderSurface.w != _dims.width() || _borderSurface.h != _dims.height()) {
+		_borderSurface.free();
+		_borderSurface.create(_dims.width(), _dims.height(), _wm->_pixelformat);
+	}
 }
 
 void MacWindow::setCloseable(bool closeable) {
diff --git a/graphics/macgui/macwindowborder.cpp b/graphics/macgui/macwindowborder.cpp
index b4711f476c5..23a1ddf120f 100644
--- a/graphics/macgui/macwindowborder.cpp
+++ b/graphics/macgui/macwindowborder.cpp
@@ -200,6 +200,8 @@ void MacWindowBorder::drawTitle(ManagedSurface *g, MacWindowManager *wm, int tit
 }
 
 void MacWindowBorder::setBorderType(int type) {
+	setOffsets(_window->_wm->getBorderOffsets(type));
+
 	_useInternalBorder = true;
 	_borderType = type;
 }




More information about the Scummvm-git-logs mailing list