mirror of
https://github.com/google/blockly.git
synced 2026-03-09 23:00:10 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user