From 31c3cf8d402f878d9302d1b1ef0f55737df62cfb Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 6 Sep 2021 20:29:10 +0000 Subject: [PATCH] fix: loading blocks in RTL --- core/serialization/blocks.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/serialization/blocks.js b/core/serialization/blocks.js index 5b555bfca..d6616b85b 100644 --- a/core/serialization/blocks.js +++ b/core/serialization/blocks.js @@ -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); };