diff options
author | vaxerski <[email protected]> | 2024-03-26 13:35:03 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2024-03-26 13:35:03 +0000 |
commit | 1a0b8d1263a318146ce63062115332c725e79edf (patch) | |
tree | 946163aca72fa6b53f636f26c4984bc29114ea54 | |
parent | a9d7526aae38dcdceb391fe9f00919c6c400abe3 (diff) | |
download | Hyprland-1a0b8d1263a318146ce63062115332c725e79edf.tar.gz Hyprland-1a0b8d1263a318146ce63062115332c725e79edf.zip |
renderer: minor fixes to misaligned reported surface rendering
fixes #5257
-rw-r--r-- | src/render/Renderer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 4680568c..f94a3688 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -91,11 +91,9 @@ static void renderSurface(struct wlr_surface* surface, int x, int y, void* data) } if (!INTERACTIVERESIZEINPROGRESS && PSURFACE && PWINDOW && PWINDOW->m_vRealSize.goal().floor() > PWINDOW->m_vReportedSize && PWINDOW->m_vReportedSize > Vector2D{1, 1}) { - Vector2D coeff = PWINDOW->m_vReportedSize / PWINDOW->m_vRealSize.value(); - Vector2D coeff2 = PWINDOW->m_vReportedSize / PWINDOW->m_vRealSize.goal(); - - Vector2D size = Vector2D{windowBox.w, windowBox.h} * coeff; - Vector2D correct = Vector2D{windowBox.w, windowBox.h} - Vector2D{windowBox.w, windowBox.h} * coeff2; + Vector2D size = + Vector2D{windowBox.w * (PWINDOW->m_vReportedSize.x / PWINDOW->m_vRealSize.value().x), windowBox.h * (PWINDOW->m_vReportedSize.y / PWINDOW->m_vRealSize.value().y)}; + Vector2D correct = Vector2D{windowBox.w, windowBox.h} - size; windowBox.translate(correct / 2.0); |