Quest book map tab: keep the cursor visible
The zoomed map view resets the viewport to the full render size when done; the HUD layer shifted that reset past the render target, SetViewport failed and the map's 256x256 viewport stayed set, clipping the cursor. Full-width viewports at x 0 are no longer shifted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
46a08e97e9
commit
5a0db24b83
2 files changed
+17
-1
No files matched your search
+6
-1
@@ -402,8 +402,13 @@ using ClearFn = HRESULT(__stdcall*)(void* device, DWORD count, Rect7* rects, DWO
|
||||
SetViewportFn g_setViewport = nullptr;
|
||||
ClearFn g_clear = nullptr;
|
||||
|
||||
// A viewport across the whole render width is a reset, not one of the window's
|
||||
// own (e.g. the zoomed map view in the quest book restores it with 0x646510
|
||||
// when done): shifted, it would reach past the render target, SetViewport
|
||||
// fails and the window's small viewport stays set, clipping the cursor.
|
||||
HRESULT __stdcall SetViewportShifted(void* device, Viewport7* viewport) {
|
||||
if (g_offsetX == 0 || !viewport) {
|
||||
if (g_offsetX == 0 || !viewport ||
|
||||
(viewport->x == 0 && static_cast<int>(viewport->width) >= mods::widescreen::RenderWidth())) {
|
||||
return g_setViewport(device, viewport);
|
||||
}
|
||||
Viewport7 shifted = *viewport;
|
||||
|
||||
Reference in new issue
Block a user