fix: PowerPoint preview centres titles the file aligns left (#32876)

In the PowerPoint preview, a title or subtitle that the file sets to left alignment was drawn centred, the same as one with no alignment at all. Decks made by python-pptx and most deck generators set the alignment on every paragraph, so their left-aligned title slides all came out centred. The preview now keeps a title the file aligns left on the left, and only centres titles and subtitles that leave the alignment open.

Fixes #32873
This commit is contained in:
Classic298 2026-10-22 00:01:10 +02:00 • committed by GitHub
parent 095cca5fca
commit 8fa77c8282
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,6 +257,8 @@ const paragraphAlign = (
const align = para.getElementsByTagName('a:pPr')[0]?.getAttribute('algn');
if (align === 'ctr') return 'center';
if (align === 'r') return 'right';
// l and the justified modes the preview cannot draw render from the left
if (align) return 'left';
const type = normalizePlaceholderType(ph?.type ?? '');
if (type === 'title' || type === 'subTitle') return 'center';