mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 05:29:48 +01:00
renderer: minor fixups for misaligned surface rendering offsets
fixes #5136
This commit is contained in:
parent
3c21f5e07b
commit
30c5911718
2 changed files with 9 additions and 4 deletions
|
@ -1058,6 +1058,9 @@ bool CWindow::opaque() {
|
|||
if (m_fAlpha.value() != 1.f || m_fActiveInactiveAlpha.value() != 1.f)
|
||||
return false;
|
||||
|
||||
if (m_vRealSize.goal().floor() != m_vReportedSize)
|
||||
return false;
|
||||
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
|
||||
|
||||
if (m_pWLSurface.small() && !m_pWLSurface.m_bFillIgnoreSmall)
|
||||
|
|
|
@ -92,10 +92,12 @@ static void renderSurface(struct wlr_surface* surface, int x, int y, void* data)
|
|||
}
|
||||
}
|
||||
|
||||
if (!INTERACTIVERESIZEINPROGRESS && PSURFACE && PWINDOW && PWINDOW->m_vRealSize.goal() > PWINDOW->m_vReportedSize && PWINDOW->m_vReportedSize > Vector2D{1, 1}) {
|
||||
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;
|
||||
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;
|
||||
|
||||
windowBox.translate(correct / 2.0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue