We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58d7394 commit 05fe1fbCopy full SHA for 05fe1fb
1 file changed
core/xml.js
@@ -86,13 +86,13 @@ Blockly.Xml.variablesToDom = function(variableList) {
86
*/
87
Blockly.Xml.blockToDomWithXY = function(block, opt_noId) {
88
var width; // Not used in LTR.
89
- if (block.workspace.RTL) {
+ var isRTL = block.workspace ? block.workspace.RTL : false;
90
+ if (isRTL) {
91
width = block.workspace.getWidth();
92
}
93
var element = Blockly.Xml.blockToDom(block, opt_noId);
94
var xy = block.getRelativeToSurfaceXY();
- element.setAttribute('x',
95
- Math.round(block.workspace.RTL ? width - xy.x : xy.x));
+ element.setAttribute('x', Math.round(isRTL ? width - xy.x : xy.x));
96
element.setAttribute('y', Math.round(xy.y));
97
return element;
98
};
0 commit comments