mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-16 14:22:24 +08:00
~ fix resolutions higher than your current window
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
3736c0c1b9
commit
73c40c3d4e
@ -203,6 +203,22 @@ void CWallpaper::render (glm::vec4 viewport, bool newFrame)
|
||||
float widthRatio = windowWidth / viewport.z;
|
||||
float heightRatio = windowHeight / viewport.w;
|
||||
|
||||
if (widthRatio > 1.0f)
|
||||
{
|
||||
float diff = widthRatio - 1.0f;
|
||||
|
||||
widthRatio -= diff;
|
||||
heightRatio -= diff;
|
||||
}
|
||||
|
||||
if (heightRatio > 1.0f)
|
||||
{
|
||||
float diff = heightRatio - 1.0f;
|
||||
|
||||
widthRatio -= diff;
|
||||
heightRatio -= diff;
|
||||
}
|
||||
|
||||
if (widthRatio < 1.0f)
|
||||
{
|
||||
float diff = 1.0f - widthRatio;
|
||||
@ -213,12 +229,15 @@ void CWallpaper::render (glm::vec4 viewport, bool newFrame)
|
||||
|
||||
if (heightRatio < 1.0f)
|
||||
{
|
||||
float diff = 1.0f - widthRatio;
|
||||
float diff = 1.0f - heightRatio;
|
||||
|
||||
widthRatio += diff;
|
||||
heightRatio += diff;
|
||||
}
|
||||
|
||||
if (widthRatio < 0.0f) widthRatio = -widthRatio;
|
||||
if (heightRatio < 0.0f) heightRatio = -heightRatio;
|
||||
|
||||
GLfloat position [] = {
|
||||
widthRatio * -1.0f, heightRatio * 1.0f, 0.0f,
|
||||
widthRatio * 1.0f, heightRatio * 1.0f, 0.0f,
|
||||
|
Loading…
Reference in New Issue
Block a user