mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-25 21:30:04 +01:00
renderer: fix inconsistent border thickness for roundingPower < 2 (#11752)
This commit is contained in:
parent
4fc95d646d
commit
afd1e71761
2 changed files with 14 additions and 8 deletions
|
|
@ -70,14 +70,18 @@ void CHyprBorderDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
|||
m_window->m_realBorderColorPrevious.m_angle = grad.m_angle;
|
||||
}
|
||||
|
||||
int borderSize = m_window->getRealBorderSize();
|
||||
const auto ROUNDING = m_window->rounding() * pMonitor->m_scale;
|
||||
const auto ROUNDINGPOWER = m_window->roundingPower();
|
||||
int borderSize = m_window->getRealBorderSize();
|
||||
const auto ROUNDINGBASE = m_window->rounding();
|
||||
const auto ROUNDING = ROUNDINGBASE * pMonitor->m_scale;
|
||||
const auto ROUNDINGPOWER = m_window->roundingPower();
|
||||
const auto CORRECTIONOFFSET = (borderSize * (M_SQRT2 - 1) * std::max(2.0 - ROUNDINGPOWER, 0.0));
|
||||
const auto OUTERROUND = ((ROUNDINGBASE + borderSize) - CORRECTIONOFFSET) * pMonitor->m_scale;
|
||||
|
||||
CBorderPassElement::SBorderData data;
|
||||
data.box = windowBox;
|
||||
data.grad1 = grad;
|
||||
data.round = ROUNDING;
|
||||
data.outerRound = OUTERROUND;
|
||||
data.roundingPower = ROUNDINGPOWER;
|
||||
data.a = a;
|
||||
data.borderSize = borderSize;
|
||||
|
|
|
|||
|
|
@ -117,11 +117,13 @@ void CHyprDropShadowDecoration::render(PHLMONITOR pMonitor, float const& a) {
|
|||
if (*PSHADOWS != 1)
|
||||
return; // disabled
|
||||
|
||||
const auto ROUNDINGBASE = PWINDOW->rounding();
|
||||
const auto ROUNDINGPOWER = PWINDOW->roundingPower();
|
||||
const auto ROUNDING = ROUNDINGBASE > 0 ? ROUNDINGBASE + PWINDOW->getRealBorderSize() : 0;
|
||||
const auto PWORKSPACE = PWINDOW->m_workspace;
|
||||
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
||||
const auto BORDERSIZE = PWINDOW->getRealBorderSize();
|
||||
const auto ROUNDINGBASE = PWINDOW->rounding();
|
||||
const auto ROUNDINGPOWER = PWINDOW->roundingPower();
|
||||
const auto CORRECTIONOFFSET = (BORDERSIZE * (M_SQRT2 - 1) * std::max(2.0 - ROUNDINGPOWER, 0.0));
|
||||
const auto ROUNDING = ROUNDINGBASE > 0 ? (ROUNDINGBASE + BORDERSIZE) - CORRECTIONOFFSET : 0;
|
||||
const auto PWORKSPACE = PWINDOW->m_workspace;
|
||||
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
||||
|
||||
// draw the shadow
|
||||
CBox fullBox = m_lastWindowBoxWithDecos;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue