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:
Penar Musaraj 2020-10-13 20:06:09 -04:00 committed by GitHub
parent c135f04a4f
commit 2b5ca8af12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,9 +161,9 @@ export function createPreviewComponent(width, height, obj) {
drawHeader(ctx, colors, width, headerHeight);
const avatarSize = height * 0.1;
// Logo
const headerMargin = headerHeight * 0.2;
if (logo) {
const logoHeight = headerHeight - headerMargin * 2;
const ratio = logoHeight / logo.height;
@ -176,6 +176,7 @@ export function createPreviewComponent(width, height, obj) {
);
this.scaleImage(logo, width, headerMargin);
}
// Top right menu
this.scaleImage(