diff options
| author | vaxerski <vaxry@vaxry.net> | 2023-01-05 19:25:45 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2023-01-05 19:25:45 +0100 |
| commit | 96198dae55b1429449504e49065a10763b288431 (patch) | |
| tree | ee18d707952df6fcbd4f9295e138d1571b64267b /src/helpers/Workspace.cpp | |
| parent | 0e3547e0f6b4016aa308292a86c43cd47dd206fd (diff) | |
Normalize color storage
Colors are now normalized to 0 - 1 values instead of 0 - 255
causes calculations to be simpler and generally cleans up the codebase.
Diffstat (limited to 'src/helpers/Workspace.cpp')
| -rw-r--r-- | src/helpers/Workspace.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp index d2a8cdf0..2e243403 100644 --- a/src/helpers/Workspace.cpp +++ b/src/helpers/Workspace.cpp @@ -31,7 +31,7 @@ CWorkspace::CWorkspace(int monitorID, std::string name, bool special) { m_fAlpha.m_pWorkspace = this; m_fAlpha.create(AVARTYPE_FLOAT, special ? g_pConfigManager->getAnimationPropertyConfig("specialWorkspace") : g_pConfigManager->getAnimationPropertyConfig("workspaces"), nullptr, AVARDAMAGE_ENTIRE); - m_fAlpha.setValueAndWarp(255.f); + m_fAlpha.setValueAndWarp(1.f); m_vRenderOffset.registerVar(); m_fAlpha.registerVar(); @@ -61,16 +61,16 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { if (in) { m_fAlpha.setValueAndWarp(0.f); - m_fAlpha = 255.f; + m_fAlpha = 1.f; } else { - m_fAlpha.setValueAndWarp(255.f); + m_fAlpha.setValueAndWarp(1.f); m_fAlpha = 0.f; } } else if (ANIMSTYLE == "slidevert") { // fallback is slide const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); - m_fAlpha.setValueAndWarp(255.f); // fix a bug, if switching from fade -> slide. + m_fAlpha.setValueAndWarp(1.f); // fix a bug, if switching from fade -> slide. if (in) { m_vRenderOffset.setValueAndWarp(Vector2D(0, left ? PMONITOR->vecSize.y : -PMONITOR->vecSize.y)); @@ -82,7 +82,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { // fallback is slide const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); - m_fAlpha.setValueAndWarp(255.f); // fix a bug, if switching from fade -> slide. + m_fAlpha.setValueAndWarp(1.f); // fix a bug, if switching from fade -> slide. if (in) { m_vRenderOffset.setValueAndWarp(Vector2D(left ? PMONITOR->vecSize.x : -PMONITOR->vecSize.x, 0)); @@ -102,7 +102,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); for (auto& ls : PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) { if (!ls->fadingOut) - ls->alpha = m_bHasFullscreenWindow && m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 255.f; + ls->alpha = m_bHasFullscreenWindow && m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 1.f; } } } |
