diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2022-10-07 20:12:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-07 20:12:28 +0100 |
| commit | 5e3b8c3233aef92fb56943d9e3a0fc70bcc897a0 (patch) | |
| tree | 00087216bca5cca273baa74e9b3ef8677ec4283f /src/render/OpenGL.cpp | |
| parent | a19b152e4a25be4ef8b46d4d9ca18cbd2b156498 (diff) | |
| parent | bbdfb7853d41717ad5712fd8a13de11cafc0da8f (diff) | |
Merge pull request #807 from Dickby/fix_monitor_transforms
Transform the box data send to texture shaders.
Diffstat (limited to 'src/render/OpenGL.cpp')
| -rw-r--r-- | src/render/OpenGL.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 38672353..373add64 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -443,17 +443,17 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, wlr_b glUniform1f(shader->alpha, alpha / 255.f); glUniform1i(shader->discardOpaque, (int)discardOpaque); - // round is in px - // so we need to do some maf + wlr_box transformedBox; + wlr_box_transform(&transformedBox, pBox, wlr_output_transform_invert(m_RenderData.pMonitor->transform), + m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y); - const auto TOPLEFT = Vector2D(round, round); - const auto BOTTOMRIGHT = Vector2D(pBox->width - round, pBox->height - round); - const auto FULLSIZE = Vector2D(pBox->width, pBox->height); + const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y); + const auto FULLSIZE = Vector2D(transformedBox.width, transformedBox.height); static auto *const PMULTISAMPLEEDGES = &g_pConfigManager->getConfigValuePtr("decoration:multisample_edges")->intValue; // Rounded corners - glUniform2f(shader->topLeft, pBox->x, pBox->y); - glUniform2f(shader->fullSize, pBox->width, pBox->height); + glUniform2f(shader->topLeft, TOPLEFT.x, TOPLEFT.y); + glUniform2f(shader->fullSize, FULLSIZE.x ,FULLSIZE.y); glUniform1f(shader->radius, round); glUniform1i(shader->primitiveMultisample, (int)(*PMULTISAMPLEEDGES == 1 && round != 0 && !noAA)); |
