From 52b4e74e0a5c3846d91e25f2bf55294092648c945de6251d263ae9300139b1e7 Mon Sep 17 00:00:00 2001 From: Cliff Zhao Date: Tue, 12 Jul 2022 07:51:17 +0000 Subject: [PATCH] Accepting request 988558 from home:favogt:branches:Base:System - Add patch to fix alignment with label-ft in some cases: * 0004-label-ft-fix-alignment.patch OBS-URL: https://build.opensuse.org/request/show/988558 OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=331 --- 0004-label-ft-fix-alignment.patch | 21 +++++++++++++++++++++ plymouth.changes | 6 ++++++ plymouth.spec | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 0004-label-ft-fix-alignment.patch diff --git a/0004-label-ft-fix-alignment.patch b/0004-label-ft-fix-alignment.patch new file mode 100644 index 0000000..bb957d3 --- /dev/null +++ b/0004-label-ft-fix-alignment.patch @@ -0,0 +1,21 @@ +From: Alfonso Sanchez-Beato +Subject: fix alignment for label-ft + +label->width is used to calculate wrapping of lines and it is by +default -1. We need to use label->area.width instead when aligning a +line, as label->width might not have been set. + +--- plymouth-0.9.5+git20211018.orig/src/plugins/controls/label-ft/plugin.c ++++ plymouth-0.9.5+git20211018/src/plugins/controls/label-ft/plugin.c +@@ -324,9 +324,9 @@ draw_control (ply_label_plugin_control_t + + /* Start at start position (alignment) */ + if(label->alignment == PLY_LABEL_ALIGN_CENTER) +- pen.x += (label->width - width_of_line(label, cur_c)) << 5; ++ pen.x += (label->area.width - width_of_line(label, cur_c)) << 5; + else if(label->alignment == PLY_LABEL_ALIGN_RIGHT) +- pen.x += (label->width - width_of_line(label, cur_c)) << 6; ++ pen.x += (label->area.width - width_of_line(label, cur_c)) << 6; + + while(*cur_c && *cur_c != '\n') + { diff --git a/plymouth.changes b/plymouth.changes index bcee77e..ce1106b 100644 --- a/plymouth.changes +++ b/plymouth.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 11 13:01:49 UTC 2022 - Fabian Vogt + +- Add patch to fix alignment with label-ft in some cases: + * 0004-label-ft-fix-alignment.patch + ------------------------------------------------------------------- Wed Jun 29 08:52:34 UTC 2022 - Stefan Schubert diff --git a/plymouth.spec b/plymouth.spec index 5ff4be0..f19a4f1 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -60,6 +60,8 @@ Patch1000: 0001-Add-label-ft-plugin.patch Patch1001: 0002-Install-label-ft-plugin-into-initrd-if-available.patch # PATCH-FIX-UPSTREAM 0003-fix_null_deref.patch boo#959986 fvogt@suse.com -- add ability to output text in initrd needed for encryption. Patch1002: 0003-fix_null_deref.patch +# PATCH-FIX-UPSTREAM 0004-label-ft-fix-alignment.patch boo#959986 fvogt@suse.com -- fix alignment for label-ft +Patch1003: 0004-label-ft-fix-alignment.patch BuildRequires: automake BuildRequires: docbook-xsl-stylesheets BuildRequires: gcc