mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Wizard theme preview when logo is missing (#10914)
Fixes empty theme previews in the wizard, a bug introduced by yours
truly in a4356b99af
This commit is contained in:
parent
c135f04a4f
commit
2b5ca8af12
@ -161,21 +161,22 @@ export function createPreviewComponent(width, height, obj) {
|
|||||||
drawHeader(ctx, colors, width, headerHeight);
|
drawHeader(ctx, colors, width, headerHeight);
|
||||||
|
|
||||||
const avatarSize = height * 0.1;
|
const avatarSize = height * 0.1;
|
||||||
|
|
||||||
// Logo
|
|
||||||
const headerMargin = headerHeight * 0.2;
|
const headerMargin = headerHeight * 0.2;
|
||||||
const logoHeight = headerHeight - headerMargin * 2;
|
|
||||||
|
|
||||||
const ratio = logoHeight / logo.height;
|
if (logo) {
|
||||||
this.scaleImage(
|
const logoHeight = headerHeight - headerMargin * 2;
|
||||||
logo,
|
|
||||||
headerMargin,
|
|
||||||
headerMargin,
|
|
||||||
logo.width * ratio,
|
|
||||||
logoHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
this.scaleImage(logo, width, headerMargin);
|
const ratio = logoHeight / logo.height;
|
||||||
|
this.scaleImage(
|
||||||
|
logo,
|
||||||
|
headerMargin,
|
||||||
|
headerMargin,
|
||||||
|
logo.width * ratio,
|
||||||
|
logoHeight
|
||||||
|
);
|
||||||
|
|
||||||
|
this.scaleImage(logo, width, headerMargin);
|
||||||
|
}
|
||||||
|
|
||||||
// Top right menu
|
// Top right menu
|
||||||
this.scaleImage(
|
this.scaleImage(
|
||||||
|
Loading…
Reference in New Issue
Block a user