summaryrefslogtreecommitdiff
path: root/src/ui/scrollwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:42:23 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:42:23 +0200
commit0585c687a38f0d177ec4db48567ea08326094111 (patch)
treeba1feafdda3a1258f7baa18edbe7eeaf97ff5bd8 /src/ui/scrollwidget.c
parent59363d3e230a0e9702e31936309473fb576ecec5 (diff)
parent4ae755de3ff4a37763aacc22ea119edab2099e84 (diff)
Merge branch 'dev' into work/v1.11
# Conflicts: # res/lang/eo.bin # res/lang/ie.bin
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}