GRAPHICS: MACGUI: Added support to change inner dimension of macwindow derived object

Added setInnerDimension which calls resize (with bool inner dimension change: true), moveto and finally updateOuterDimension.

This was implemented to match window rectangle size as used by window property `rect`, `rect of window` in `workshop` uses this.
This commit is contained in:
Harishankar Kumar 2023-05-31 02:08:16 +05:30 committed by Eugene Sandulenko
parent 23f1229e67
commit 4f07e8dec4
2 changed files with 17 additions and 0 deletions

View File

@ -147,6 +147,15 @@ void MacWindow::setDimensions(const Common::Rect &r) {
_wm->setFullRefresh(true);
}
void MacWindow::setInnerDimensions(const Common::Rect &r) {
resizeInner(r.width(), r.height());
_innerDims.moveTo(r.left, r.top);
updateOuterDims();
_contentIsDirty = true;
_wm->setFullRefresh(true);
}
void MacWindow::setBackgroundPattern(int pattern) {
_pattern = pattern;
_hasPattern = true;

View File

@ -233,6 +233,14 @@ public:
*/
void setDimensions(const Common::Rect &r) override;
/**
* Change the inner dimension of the window.
* Note that this changes the window inner dimension and calculates
* outer dimension (ie with border, etc)
* @param r The desired dimensions of the window.
*/
void setInnerDimensions(const Common::Rect &r);
/**
* Set a background pattern for the window.
* @param pattern