Skip to content

Commit d5b33d8

Browse files
committed
Do screenshot widget aspect ratio correction always
1 parent b129c60 commit d5b33d8

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

gfx/widgets/gfx_widget_screenshot.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ static void gfx_widget_screenshot_iterate(
366366
/* Load screenshot and start its animation */
367367
if (state->filename[0] != '\0')
368368
{
369+
video_driver_state_t *video_st = video_state_get_ptr();
369370
gfx_timer_ctx_entry_t timer;
370371

371372
video_driver_texture_unload(&state->texture);
@@ -397,17 +398,12 @@ static void gfx_widget_screenshot_iterate(
397398
state->thumbnail_height = state->texture_height * state->scale_factor;
398399

399400
/* Set image aspect ratio according to core geometry */
400-
if (state->state_slot)
401+
if (video_st && video_st->av_info.geometry.aspect_ratio > 0)
401402
{
402-
video_driver_state_t *video_st = video_state_get_ptr();
403-
404-
if (video_st && video_st->av_info.geometry.aspect_ratio > 0)
405-
{
406-
float thumbnail_aspect = (float)state->texture_width / (float)state->texture_height;
407-
float core_aspect = video_st->av_info.geometry.aspect_ratio;
403+
float thumbnail_aspect = (float)state->texture_width / (float)state->texture_height;
404+
float core_aspect = video_st->av_info.geometry.aspect_ratio;
408405

409-
state->thumbnail_width = state->thumbnail_width / (thumbnail_aspect / core_aspect);
410-
}
406+
state->thumbnail_width = state->thumbnail_width / (thumbnail_aspect / core_aspect);
411407
}
412408

413409
state->shotname_length = (width - state->thumbnail_width - padding*2) / font_regular->glyph_width;

0 commit comments

Comments
 (0)