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
This commit is contained in:
Mark Finn
2022-03-15 11:34:28 -05:00
committed by GitHub
parent 9e1cda8f45
commit fec44d917e

View File

@@ -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.