From 37ab380a6fa76f5c10684d6d647d25ee3fc32e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 3 Sep 2025 10:49:58 +0800 Subject: [PATCH] Logo (Chafa): fixes setting `logo.width` with chafa Regression in v2.51.0 Fixes #1947 --- src/logo/logo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logo/logo.c b/src/logo/logo.c index cc6814b16..a0d64b72f 100644 --- a/src/logo/logo.c +++ b/src/logo/logo.c @@ -114,7 +114,7 @@ static bool ffLogoPrintCharsRaw(const char* data, size_t length, bool printError static uint32_t logoAppendChars(const char* data, bool doColorReplacement, FFstrbuf* result) { FFOptionsLogo* options = &instance.config.logo; - uint32_t currentlineLength = options->width; + uint32_t currentlineLength = options->type == FF_LOGO_TYPE_IMAGE_CHAFA ? 0 : options->width; // For chafa, unit of options->width is pixels uint32_t logoHeight = 0; if (result) @@ -260,7 +260,7 @@ static uint32_t logoAppendChars(const char* data, bool doColorReplacement, FFstr if(currentlineLength > instance.state.logoWidth) instance.state.logoWidth = currentlineLength; - return options->height > logoHeight ? options->height : logoHeight; + return options->type != FF_LOGO_TYPE_IMAGE_CHAFA && options->height > logoHeight ? options->height : logoHeight; } void ffLogoPrintChars(const char* data, bool doColorReplacement)