diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-09-14 00:57:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-09-14 00:57:06 +0200 |
commit | 83c7b22eba0c992b30b1a100662cbc260dc974d9 (patch) | |
tree | 4c2fbd2e74ac0a44a18961b95b3b62327475dbcd /src | |
parent | 3facc8725c6b6330df016ec98636058192cf91f3 (diff) |
Fix shadow on right side of box
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 0f47a2b..6500e16 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -138,6 +138,8 @@ namespace QuickMedia { // TODO: Show chapters (rows) that have been read differently to make it easier to see what hasn't been read yet. void Body::draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress) { sf::Vector2f scissor_pos = pos; + sf::Vector2f scissor_size = size; + size.x = std::max(0.0f, size.x - 5); const float image_max_height = 100.0f; const float spacing_y = 15.0f; @@ -222,7 +224,7 @@ namespace QuickMedia { sf::Vector2u window_size = window.getSize(); glEnable(GL_SCISSOR_TEST); - glScissor(scissor_pos.x, (int)window_size.y - (int)scissor_pos.y - (int)size.y, size.x, size.y); + glScissor(scissor_pos.x, (int)window_size.y - (int)scissor_pos.y - (int)scissor_size.y, scissor_size.x, scissor_size.y); for(int i = first_visible_item + 1; i < num_items; ++i) { const auto &item = items[i]; |