summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-29 12:36:50 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-29 12:36:50 +0200
commit73663a8ba550977f2a6a2f82fefc8ca54af2a757 (patch)
tree778410500cfb39f5ed8c7003da7a452baa3602fc /src/render/Renderer.cpp
parent13acfb1c306f863b695f1aa2f678445bb39f4239 (diff)
fix incorrect snapshot calc for scaled outputs
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 67f43ff5..e0891710 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -13,12 +13,15 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
wlr_box windowBox;
if (RDATA->surface && surface == RDATA->surface) {
- windowBox = {(int)outputX + RDATA->x + x, (int)outputY + RDATA->y + y, RDATA->w, RDATA->h};
+ windowBox = {(int)RDATA->x + x, (int)RDATA->y + y, RDATA->w, RDATA->h};
} else { // here we clamp to 2, these might be some tiny specks
- windowBox = {(int)outputX + RDATA->x + x, (int)outputY + RDATA->y + y, std::clamp(surface->current.width, 2, 1337420), std::clamp(surface->current.height, 2, 1337420)};
+ windowBox = {(int)RDATA->x + x, (int)RDATA->y + y, std::clamp(surface->current.width, 2, 1337420), std::clamp(surface->current.height, 2, 1337420)};
}
scaleBox(&windowBox, RDATA->output->scale);
+ windowBox.x += outputX;
+ windowBox.y += outputY;
+
static auto *const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue;
float rounding = RDATA->dontRound ? 0 : RDATA->rounding == -1 ? *PROUNDING : RDATA->rounding;
@@ -578,9 +581,7 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) {
void CHyprRenderer::damageWindow(CWindow* pWindow) {
wlr_box damageBox = pWindow->getFullWindowBoundingBox();
for (auto& m : g_pCompositor->m_lMonitors) {
- wlr_box fixedDamageBox = damageBox;
- fixedDamageBox.x -= m.vecPosition.x;
- fixedDamageBox.y -= m.vecPosition.y;
+ wlr_box fixedDamageBox = {damageBox.x - m.vecPosition.x, damageBox.y - m.vecPosition.y, damageBox.width, damageBox.height};
scaleBox(&fixedDamageBox, m.scale);
wlr_output_damage_add_box(m.damage, &fixedDamageBox);
}