Skip to content

Commit 5a9d618

Browse files
committed
fix(sb3_definitions): fix comment position validation
A comment's x and y can be null. This will occur if a project is imported from 2.0, a sprite that is not currently selected has comments, and that project is immediately saved in 3.0 without switching to the other sprite that has comments.
1 parent 660d56e commit 5a9d618

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/sb3_definitions.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
{"type": "null"}
1010
]
1111
},
12+
"optionalNumber": {
13+
"oneOf": [
14+
{"type": "number"},
15+
{"type": "null"}
16+
]
17+
},
1218
"boolOrOptBoolString": {
1319
"oneOf": [
1420
{"type": "string",
@@ -294,8 +300,8 @@
294300
"maxLength": 8000
295301
},
296302
"minimized": {"type": "boolean"},
297-
"x": {"type": "number"},
298-
"y": {"type": "number"},
303+
"x": {"$ref": "#/definitions/optionalNumber"},
304+
"y": {"$ref": "#/definitions/optionalNumber"},
299305
"width": {"type": "number"},
300306
"height": {"type": "number"}
301307
},

0 commit comments

Comments
 (0)