diff --git a/src/gfx.cpp b/src/gfx.cpp index e6765db622..1543ed7ea3 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -83,9 +83,6 @@ int _gui_scale_cfg; ///< GUI scale in config. static const byte *_colour_remap_ptr; static byte _string_colourremap[3]; ///< Recoloursprite for stringdrawing. The grf loader ensures that #ST_FONT sprites only use colours 0 to 2. -static const uint DIRTY_BLOCK_HEIGHT = 8; -static const uint DIRTY_BLOCK_WIDTH = 64; - extern uint _dirty_block_colour; static bool _whole_screen_dirty = false; bool _gfx_draw_active = false; @@ -1687,7 +1684,7 @@ static void DrawDirtyViewport(uint occlusion, int left, int top, int right, int ViewportDrawChk(_dirty_viewport, left, top, right, bottom); if (_dirty_viewport_disp_flags & (ND_SHADE_GREY | ND_SHADE_DIMMED)) { - GfxFillRect(left, top, right, bottom, + GfxFillRect(left, top, right - 1, bottom - 1, (_dirty_viewport_disp_flags & ND_SHADE_DIMMED) ? PALETTE_TO_TRANSPARENT : PALETTE_NEWSPAPER, FILLRECT_RECOLOUR); } VideoDriver::GetInstance()->MakeDirty(left, top, right - left, bottom - top); diff --git a/src/viewport.cpp b/src/viewport.cpp index 16d47f6ecc..98ef07e2f5 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -279,8 +279,8 @@ void InitializeWindowViewport(Window *w, int x, int y, vp->virtual_left = 0; vp->virtual_top = 0; - vp->virtual_width = ScaleByZoom(width, zoom); - vp->virtual_height = ScaleByZoom(height, zoom); + vp->virtual_width = ScaleByZoom(width, vp->zoom); + vp->virtual_height = ScaleByZoom(height, vp->zoom); UpdateViewportSizeZoom(vp); diff --git a/src/widget.cpp b/src/widget.cpp index 33e0c2bd9d..8297f6fb19 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1025,7 +1025,7 @@ NWidgetBase::NWidgetBase(WidgetType tp) : ZeroedMemoryAllocator() void NWidgetBase::SetDirty(Window *w) { this->base_flags |= WBF_DIRTY; - w->flags |= WF_DIRTY; + w->flags |= WF_WIDGETS_DIRTY; } /** @@ -2397,8 +2397,8 @@ void NWidgetViewport::UpdateViewportCoordinates(Window *w) if (vp != nullptr) { vp->left = w->left + this->pos_x; vp->top = w->top + this->pos_y; - vp->width = this->current_x; - vp->height = this->current_y; + vp->width = w->IsShaded() ? 0 : this->current_x; + vp->height = w->IsShaded() ? 0 : this->current_y; vp->virtual_width = ScaleByZoom(vp->width, vp->zoom); vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);