fix: loading blocks in RTL

This commit is contained in:
Beka Westberg
2021-09-06 20:29:10 +00:00
committed by alschmiedt
parent a4d84e57f8
commit 17f9f4f689

View File

@@ -399,8 +399,12 @@ const loadPrivate = function(
* @param {!State} state The state object to reference.
*/
const loadCoords = function(block, state) {
const x = state['x'] === undefined ? 0 : state['x'];
let x = state['x'] === undefined ? 0 : state['x'];
const y = state['y'] === undefined ? 0 : state['y'];
const workspace = block.workspace;
x = workspace.RTL ? workspace.getWidth() - x : x;
block.moveBy(x, y);
};