From 3e3dd2a653a6741aeaed18cd8327ec7c396d4b7b Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Tue, 11 Feb 2025 11:06:23 -0300 Subject: [PATCH] Fix timeline thumbnail zoom can't scale beyond 1:1 pixels (fix #4974) Prior this fix when using large thumbnail sizes on the timeline with smaller cel images, instead of enlarging the thumbnail image to fit the full area available, it just adds transparent whitespace around the thumbnail image. --- src/app/thumbnails.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/thumbnails.cpp b/src/app/thumbnails.cpp index 971cc81bc..eedae9fa6 100644 --- a/src/app/thumbnails.cpp +++ b/src/app/thumbnails.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019-2020 Igara Studio S.A. +// Copyright (C) 2019-2025 Igara Studio S.A. // Copyright (C) 2018 David Capello // Copyright (C) 2016 Carlo Caputo // @@ -23,13 +23,7 @@ namespace app { namespace thumb { os::SurfaceRef get_cel_thumbnail(const doc::Cel* cel, const gfx::Size& fitInSize) { - gfx::Size newSize; - - if (cel->bounds().w > fitInSize.w || cel->bounds().h > fitInSize.h) - newSize = gfx::Rect(cel->bounds()).fitIn(gfx::Rect(fitInSize)).size(); - else - newSize = cel->bounds().size(); - + gfx::Size newSize(gfx::Rect(cel->bounds()).fitIn(gfx::Rect(fitInSize)).size()); if (newSize.w < 1 || newSize.h < 1) return nullptr;