mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r18607) -Fix (r18583): Preserve window width when shading.
This commit is contained in:
parent
3323d64f28
commit
b30e56850c
@ -552,13 +552,13 @@ void Window::SetShaded(bool make_shaded)
|
|||||||
{
|
{
|
||||||
if (this->shade_select == NULL) return;
|
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 (this->shade_select->shown_plane != desired) {
|
||||||
if (make_shaded) {
|
if (make_shaded) {
|
||||||
this->unshaded_size.width = this->width;
|
this->unshaded_size.width = this->width;
|
||||||
this->unshaded_size.height = this->height;
|
this->unshaded_size.height = this->height;
|
||||||
this->shade_select->SetDisplayedPlane(desired);
|
this->shade_select->SetDisplayedPlane(desired);
|
||||||
this->ReInit();
|
this->ReInit(0, -this->height);
|
||||||
} else {
|
} else {
|
||||||
this->shade_select->SetDisplayedPlane(desired);
|
this->shade_select->SetDisplayedPlane(desired);
|
||||||
int dx = ((int)this->unshaded_size.width > this->width) ? (int)this->unshaded_size.width - this->width : 0;
|
int dx = ((int)this->unshaded_size.width > this->width) ? (int)this->unshaded_size.width - this->width : 0;
|
||||||
|
@ -540,7 +540,7 @@ public:
|
|||||||
/** Is window shaded currently? */
|
/** Is window shaded currently? */
|
||||||
inline bool IsShaded() const
|
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);
|
void SetShaded(bool make_shaded);
|
||||||
|
Loading…
Reference in New Issue
Block a user