From 0963bfe4c252c4a633d8f9c01efe47aa7a62d639 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Sun, 3 Aug 2025 20:37:59 -0500 Subject: [PATCH] Atlas: oh, think about the gutters too... --- src/renderer/atlas/BackendD3D.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/renderer/atlas/BackendD3D.cpp b/src/renderer/atlas/BackendD3D.cpp index 7516ca32b2..1668a90f35 100644 --- a/src/renderer/atlas/BackendD3D.cpp +++ b/src/renderer/atlas/BackendD3D.cpp @@ -2340,10 +2340,16 @@ void BackendD3D::_executeCustomShader(RenderingPayload& p) const auto now = queryPerfCount(); const auto time = static_cast(now % _customShaderPerfTickMod) * _customShaderSecsPerPerfTick; - f32x2 scale = { + const f32x2 scale = { 1.0f / p.s->targetSize.x, - /*-*/1.0f / p.s->targetSize.y, + 1.0f / p.s->targetSize.y, }; + + const f32x2 physicalVpSize = { + p.s->viewportCellCount.x * p.s->font->cellSize.x, + p.s->viewportCellCount.y * p.s->font->cellSize.y, + }; + const CustomConstBuffer data{ .time = time, .scale = static_cast(p.s->font->dpi) / static_cast(USER_DEFAULT_SCREEN_DPI), @@ -2353,14 +2359,10 @@ void BackendD3D::_executeCustomShader(RenderingPayload& p) }, .background = colorFromU32Premultiply(p.s->misc->backgroundColor), .viewport = { - static_cast(p.s->misc->padding.x) * scale.x, //- 1.0f, - static_cast(p.s->misc->padding.y) * scale.y, //+ 1.0f, - static_cast(p.s->targetSize.x - p.s->misc->padding.z) * scale.x, // - 1.0f, - static_cast(p.s->targetSize.y - p.s->misc->padding.w) * scale.y, // + 1.0f, - //-1.f + (static_cast(p.s->misc->padding.x) / static_cast(p.s->targetSize.x)), - //-1.f + (static_cast(p.s->misc->padding.y) / static_cast(p.s->targetSize.y)), - //-1.f + (static_cast(p.s->targetSize.x - p.s->misc->padding.z) / static_cast(p.s->targetSize.x)), - //-1.f + (static_cast(p.s->targetSize.y - p.s->misc->padding.w) / static_cast(p.s->targetSize.y)), + static_cast(p.s->misc->padding.x) * scale.x, + static_cast(p.s->misc->padding.y) * scale.y, + static_cast(p.s->misc->padding.x + physicalVpSize.x) * scale.x, + static_cast(p.s->misc->padding.y + physicalVpSize.y) * scale.y, } };