fix rounding

modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
This commit is contained in:
MightyPlaza 2023-09-12 23:25:44 +01:00
parent 54575656ce
commit db555b9ac9
No known key found for this signature in database
GPG key ID: 284C27FD27A6DC0D

View file

@ -101,10 +101,10 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D&
return; return;
// Bottom left of groupbar // Bottom left of groupbar
Vector2D pos = Vector2D(std::round(m_vLastWindowPos.x - pMonitor->vecPosition.x + offset.x + ROUNDING), Vector2D pos = Vector2D(m_vLastWindowPos.x - pMonitor->vecPosition.x + offset.x + ROUNDING,
std::round(m_vLastWindowPos.y - pMonitor->vecPosition.y + offset.y) + std::floor(m_vLastWindowPos.y) - pMonitor->vecPosition.y + offset.y +
(m_bOnTop ? (m_bInternalBorder ? 0 : -BORDERSIZE) : (m_bOnTop ? (m_bInternalBorder ? 0 : -BORDERSIZE) :
std::round(m_vLastWindowSize.y) + m_iBarInternalHeight + BAR_INTERNAL_PADDING + (m_bInternalBorder ? 0 : BORDERSIZE))); std::floor(m_vLastWindowSize.y) + m_iBarInternalHeight + BAR_INTERNAL_PADDING + (m_bInternalBorder ? 0 : BORDERSIZE)));
wlr_box barBox = {pos.x, pos.y - m_iBarHeight + (m_bOnTop ? -BAR_INTERNAL_PADDING : 0), BARW, m_iBarHeight}; wlr_box barBox = {pos.x, pos.y - m_iBarHeight + (m_bOnTop ? -BAR_INTERNAL_PADDING : 0), BARW, m_iBarHeight};
wlr_box gradBox = {pos.x, pos.y - m_iBarHeight + (m_bOnTop ? -2 * BAR_INTERNAL_PADDING : -BAR_INTERNAL_PADDING) - m_iGradientHeight, BARW, m_iGradientHeight}; wlr_box gradBox = {pos.x, pos.y - m_iBarHeight + (m_bOnTop ? -2 * BAR_INTERNAL_PADDING : -BAR_INTERNAL_PADDING) - m_iGradientHeight, BARW, m_iGradientHeight};