From b30e56850cc77ef3de16e2bc721b7e704d1a12fb Mon Sep 17 00:00:00 2001 From: alberth Date: Tue, 22 Dec 2009 20:53:28 +0000 Subject: [PATCH] (svn r18607) -Fix (r18583): Preserve window width when shading. --- src/window.cpp | 4 ++-- src/window_gui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 45484cf09c..d35ec21ffc 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -552,13 +552,13 @@ void Window::SetShaded(bool make_shaded) { if (this->shade_select == NULL) return; - int desired = make_shaded ? SZSP_NONE : 0; + int desired = make_shaded ? SZSP_HORIZONTAL : 0; if (this->shade_select->shown_plane != desired) { if (make_shaded) { this->unshaded_size.width = this->width; this->unshaded_size.height = this->height; this->shade_select->SetDisplayedPlane(desired); - this->ReInit(); + this->ReInit(0, -this->height); } else { this->shade_select->SetDisplayedPlane(desired); int dx = ((int)this->unshaded_size.width > this->width) ? (int)this->unshaded_size.width - this->width : 0; diff --git a/src/window_gui.h b/src/window_gui.h index d36b704ad2..f4a13e921e 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -540,7 +540,7 @@ public: /** Is window shaded currently? */ inline bool IsShaded() const { - return this->shade_select != NULL && this->shade_select->shown_plane == SZSP_NONE; + return this->shade_select != NULL && this->shade_select->shown_plane == SZSP_HORIZONTAL; } void SetShaded(bool make_shaded);