Selaa lähdekoodia

testcontroller: make sure touchpad touches are visible even at very light pressure

Sam Lantinga 2 viikkoa sitten
vanhempi
commit
a95f5f9874
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      test/gamepadutils.c

+ 1 - 1
test/gamepadutils.c

@@ -999,7 +999,7 @@ void RenderGamepadImage(GamepadImage *ctx)
                     dst.y -= ctx->button_height / 2;
                     dst.w = ctx->button_width;
                     dst.h = ctx->button_height;
-                    SDL_SetTextureAlphaMod(ctx->button_texture, (Uint8)(finger->pressure * SDL_ALPHA_OPAQUE));
+                    SDL_SetTextureAlphaMod(ctx->button_texture, (Uint8)((0.1f + (finger->pressure * 0.9f)) * SDL_ALPHA_OPAQUE));
                     SDL_RenderTexture(ctx->renderer, ctx->button_texture, NULL, &dst);
                     SDL_SetTextureAlphaMod(ctx->button_texture, SDL_ALPHA_OPAQUE);
                 }