Skip to content

Commit

Permalink
Fixed Box Shadow wrong offset when GUI Object size is small (uQ82SvoYxR)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder committed May 25, 2023
1 parent 86bb08d commit c30a050
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Src/ssGUI/Extensions/BoxShadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ namespace Extensions
//Do the rendering here....
auto shadowPos = Container->GetGlobalPosition() + GetPositionOffset() + GetBlurRadius();
auto shadowSize = Container->GetSize() + GetSizeOffset() - GetBlurRadius() * 2;
shadowSize.x = shadowSize.x < GetBlurRadius() ? GetBlurRadius() : shadowSize.x;
shadowSize.y = shadowSize.y < GetBlurRadius() ? GetBlurRadius() : shadowSize.y;

shadowSize.x = shadowSize.x < 0 ? 0 : shadowSize.x;
shadowSize.y = shadowSize.y < 0 ? 0 : shadowSize.y;

newVertices.push_back(shadowPos);
newVertices.push_back(shadowPos + glm::vec2(shadowSize.x, 0));
Expand Down

0 comments on commit c30a050

Please sign in to comment.