Skip to content

Commit

Permalink
fix: Change the truthy tests of width and height in WorkspaceSvg.setC…
Browse files Browse the repository at this point in the history
…achedParentSvgSize to actual comparisons with null so that zero value can be saved into the cache (#5997)

fixes #5930 and possibly #5404
  • Loading branch information
markfinn committed Mar 15, 2022
1 parent 9e1cda8 commit fec44d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fec44d9

Please sign in to comment.