mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
renderer: minor alpha improvements
This commit is contained in:
parent
b9c88e8600
commit
40802b9672
2 changed files with 7 additions and 5 deletions
|
@ -128,7 +128,7 @@ CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
SRenderFeedback feedback;
|
SRenderFeedback feedback;
|
||||||
|
|
||||||
|
@ -162,6 +162,8 @@ CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf
|
||||||
|
|
||||||
feedback.needsFrame = feedback.needsFrame || !asyncResourceGatherer->ready || bga < 1.0;
|
feedback.needsFrame = feedback.needsFrame || !asyncResourceGatherer->ready || bga < 1.0;
|
||||||
|
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
return feedback;
|
return feedback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,9 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
||||||
float passAlpha = g_pHyprlock->passwordCheckWaiting() ? 0.5 : 1.0;
|
float passAlpha = g_pHyprlock->passwordCheckWaiting() ? 0.5 : 1.0;
|
||||||
|
|
||||||
CColor outerCol = outer;
|
CColor outerCol = outer;
|
||||||
outer.a = fade.a * data.opacity;
|
outer.a *= fade.a * data.opacity;
|
||||||
CColor innerCol = inner;
|
CColor innerCol = inner;
|
||||||
innerCol.a = fade.a * data.opacity;
|
innerCol.a *= fade.a * data.opacity;
|
||||||
CColor fontCol = font;
|
CColor fontCol = font;
|
||||||
fontCol.a *= fade.a * data.opacity * passAlpha;
|
fontCol.a *= fade.a * data.opacity * passAlpha;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
||||||
Vector2D currentPos = inputFieldBox.pos() + Vector2D{PASS_SPACING * 4, inputFieldBox.h / 2.f - PASS_SIZE / 2.f} +
|
Vector2D currentPos = inputFieldBox.pos() + Vector2D{PASS_SPACING * 4, inputFieldBox.h / 2.f - PASS_SIZE / 2.f} +
|
||||||
Vector2D{(PASS_SIZE + PASS_SPACING) * std::floor(dots.currentAmount), 0};
|
Vector2D{(PASS_SIZE + PASS_SPACING) * std::floor(dots.currentAmount), 0};
|
||||||
CBox box{currentPos, Vector2D{PASS_SIZE, PASS_SIZE}};
|
CBox box{currentPos, Vector2D{PASS_SIZE, PASS_SIZE}};
|
||||||
fontCol.a = (dots.currentAmount - std::floor(dots.currentAmount)) * data.opacity;
|
fontCol.a *= (dots.currentAmount - std::floor(dots.currentAmount)) * data.opacity;
|
||||||
g_pRenderer->renderRect(box, fontCol, PASS_SIZE / 2.0);
|
g_pRenderer->renderRect(box, fontCol, PASS_SIZE / 2.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue