summaryrefslogtreecommitdiff
path: root/src/ui/scrollwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/scrollwidget.c')
-rw-r--r--src/ui/scrollwidget.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ui/scrollwidget.c b/src/ui/scrollwidget.c
index 651669c6..71e4873f 100644
--- a/src/ui/scrollwidget.c
+++ b/src/ui/scrollwidget.c
@@ -239,15 +239,17 @@ static void draw_ScrollWidget_(const iScrollWidget *d) {
239 init_Paint(&p); 239 init_Paint(&p);
240 /* Blend if opacity is not at maximum. */ 240 /* Blend if opacity is not at maximum. */
241 p.alpha = 255 * value_Anim(&d->opacity); 241 p.alpha = 255 * value_Anim(&d->opacity);
242 SDL_Renderer *render = renderer_Window(get_Window()); 242 if (p.alpha > 0) {
243 if (p.alpha < 255) { 243 SDL_Renderer *render = renderer_Window(get_Window());
244 SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_BLEND); 244 if (p.alpha < 255) {
245 } 245 SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_BLEND);
246 const iRect thumbRect = shrunk_Rect( 246 }
247 thumbRect_ScrollWidget_(d), init_I2(isPressed ? gap_UI : (gap_UI * 4 / 3), gap_UI / 2)); 247 const iRect thumbRect = shrunk_Rect(
248 fillRect_Paint(&p, thumbRect, isPressed ? uiBackgroundPressed_ColorId : tmQuote_ColorId); 248 thumbRect_ScrollWidget_(d), init_I2(isPressed ? gap_UI : (gap_UI * 4 / 3), gap_UI / 2));
249 if (p.alpha < 255) { 249 fillRect_Paint(&p, thumbRect, isPressed ? uiBackgroundPressed_ColorId : tmQuote_ColorId);
250 SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_NONE); 250 if (p.alpha < 255) {
251 SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_NONE);
252 }
251 } 253 }
252 } 254 }
253} 255}