Viewport: Fix viewport updates being applied to shaded windows

This commit is contained in:
Jonathan G Rennison
2020-03-28 23:54:01 +00:00
parent c5c24a3165
commit 0a6a38886d
2 changed files with 3 additions and 3 deletions

View File

@@ -1559,7 +1559,7 @@ void DrawDirtyBlocks()
w->flags &= ~WF_WIDGETS_DIRTY; w->flags &= ~WF_WIDGETS_DIRTY;
} }
if (w->viewport != nullptr) { if (w->viewport != nullptr && !w->IsShaded()) {
ViewPort *vp = w->viewport; ViewPort *vp = w->viewport;
if (vp->is_drawn) { if (vp->is_drawn) {
vp->ClearDirty(); vp->ClearDirty();

View File

@@ -2002,8 +2002,8 @@ void NWidgetViewport::UpdateViewportCoordinates(Window *w)
if (vp != nullptr) { if (vp != nullptr) {
vp->left = w->left + this->pos_x; vp->left = w->left + this->pos_x;
vp->top = w->top + this->pos_y; vp->top = w->top + this->pos_y;
vp->width = this->current_x; vp->width = w->IsShaded() ? 0 : this->current_x;
vp->height = this->current_y; vp->height = w->IsShaded() ? 0 : this->current_y;
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom); vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom); vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);