Skip to content

Commit

Permalink
Change int radians to float in GLSL 140
Browse files Browse the repository at this point in the history
  • Loading branch information
matinlotfali committed Feb 2, 2024
1 parent bdf6715 commit bc7f6b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/shaders/shapecorners.frag
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uniform vec2 windowSize; // Containing `window->frameGeometry().size()`
uniform vec2 windowExpandedSize; // Containing `window->expandedGeometry().size()`
uniform bool disableRoundedTile;

uniform vec2 windowTopLeft; /* Containing the distance between the top-left of `expandedGeometry` and
uniform vec2 windowTopLeft; /* The distance between the top-left of `expandedGeometry` and
* the top-left of `frameGeometry`. When `windowTopLeft = {0,0}`, it means
* `expandedGeometry = frameGeometry` and there is no shadow. */

Expand Down
16 changes: 8 additions & 8 deletions src/shaders/shapecorners_core.frag
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,25 @@ void main(void)
*/
if (coord0.y < r) {
if (coord0.x < r)
tex = shapeCorner(coord0, tex, vec2(0, 0), radians(45)); // Section TL
tex = shapeCorner(coord0, tex, vec2(0, 0), radians(45.0)); // Section TL
else if (coord0.x > windowSize.x - r)
tex = shapeCorner(coord0, tex, vec2(windowSize.x, 0), radians(135)); // Section TR
tex = shapeCorner(coord0, tex, vec2(windowSize.x, 0), radians(135.0)); // Section TR
else if (coord0.y < outlineThickness)
tex = shapeCorner(coord0, tex, vec2(coord0.x, 0), radians(90)); // Section T
tex = shapeCorner(coord0, tex, vec2(coord0.x, 0), radians(90.0)); // Section T
}
else if (coord0.y > windowSize.y - r) {
if (coord0.x < r)
tex = shapeCorner(coord0, tex, vec2(0, windowSize.y), radians(315)); // Section BL
tex = shapeCorner(coord0, tex, vec2(0, windowSize.y), radians(315.0)); // Section BL
else if (coord0.x > windowSize.x - r)
tex = shapeCorner(coord0, tex, vec2(windowSize.x, windowSize.y), radians(225)); // Section BR
tex = shapeCorner(coord0, tex, vec2(windowSize.x, windowSize.y), radians(225.0)); // Section BR
else if (coord0.y > windowSize.y - outlineThickness)
tex = shapeCorner(coord0, tex, vec2(coord0.x, windowSize.y), radians(270)); // Section B
tex = shapeCorner(coord0, tex, vec2(coord0.x, windowSize.y), radians(270.0)); // Section B
}
else {
if (coord0.x < r)
tex = shapeCorner(coord0, tex, vec2(0, coord0.y), radians(0)); // Section L
tex = shapeCorner(coord0, tex, vec2(0, coord0.y), radians(0.0)); // Section L
else if (coord0.x > windowSize.x - r)
tex = shapeCorner(coord0, tex, vec2(windowSize.x, coord0.y), radians(180)); // Section R
tex = shapeCorner(coord0, tex, vec2(windowSize.x, coord0.y), radians(180.0)); // Section R

// For section x, the tex is not changing
}
Expand Down

0 comments on commit bc7f6b1

Please sign in to comment.