Skip to content

Commit

Permalink
fix(sb3_definitions): fix comment position validation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kchadha committed Aug 13, 2018
1 parent 660d56e commit 5a9d618
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/sb3_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
{"type": "null"}
]
},
"optionalNumber": {
"oneOf": [
{"type": "number"},
{"type": "null"}
]
},
"boolOrOptBoolString": {
"oneOf": [
{"type": "string",
Expand Down Expand Up @@ -294,8 +300,8 @@
"maxLength": 8000
},
"minimized": {"type": "boolean"},
"x": {"type": "number"},
"y": {"type": "number"},
"x": {"$ref": "#/definitions/optionalNumber"},
"y": {"$ref": "#/definitions/optionalNumber"},
"width": {"type": "number"},
"height": {"type": "number"}
},
Expand Down

0 comments on commit 5a9d618

Please sign in to comment.