Skip to content

Commit 37ab380

Browse files
committed
Logo (Chafa): fixes setting logo.width with chafa
Regression in v2.51.0 Fixes #1947
1 parent a06e245 commit 37ab380

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/logo/logo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static bool ffLogoPrintCharsRaw(const char* data, size_t length, bool printError
114114
static uint32_t logoAppendChars(const char* data, bool doColorReplacement, FFstrbuf* result)
115115
{
116116
FFOptionsLogo* options = &instance.config.logo;
117-
uint32_t currentlineLength = options->width;
117+
uint32_t currentlineLength = options->type == FF_LOGO_TYPE_IMAGE_CHAFA ? 0 : options->width; // For chafa, unit of options->width is pixels
118118
uint32_t logoHeight = 0;
119119

120120
if (result)
@@ -260,7 +260,7 @@ static uint32_t logoAppendChars(const char* data, bool doColorReplacement, FFstr
260260
if(currentlineLength > instance.state.logoWidth)
261261
instance.state.logoWidth = currentlineLength;
262262

263-
return options->height > logoHeight ? options->height : logoHeight;
263+
return options->type != FF_LOGO_TYPE_IMAGE_CHAFA && options->height > logoHeight ? options->height : logoHeight;
264264
}
265265

266266
void ffLogoPrintChars(const char* data, bool doColorReplacement)

0 commit comments

Comments
 (0)