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

This commit is contained in:
Sam Lantinga 2026-05-28 09:58:33 -07:00
parent bb3c61390a
commit a95f5f9874

View file

@ -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);
}