From fec44d917e4b8475beba28e4769a50982425e887 Mon Sep 17 00:00:00 2001 From: Mark Finn Date: Tue, 15 Mar 2022 11:34:28 -0500 Subject: [PATCH] fix: Change the truthy tests of width and height in WorkspaceSvg.setCachedParentSvgSize to actual comparisons with null so that zero value can be saved into the cache (#5997) fixes #5930 and possibly #5404 --- core/workspace_svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index c38a143e2..c6226068a 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1244,13 +1244,13 @@ class WorkspaceSvg extends Workspace { */ setCachedParentSvgSize(width, height) { const svg = this.getParentSvg(); - if (width) { + if (width != null) { this.cachedParentSvgSize_.width = width; // This is set to support the public (but deprecated) Blockly.svgSize // method. svg.cachedWidth_ = width; } - if (height) { + if (height != null) { this.cachedParentSvgSize_.height = height; // This is set to support the public (but deprecated) Blockly.svgSize // method.