From 17f9f4f6896b8faa2e928b7a86bdb698fb7f62fa 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 20633a3022f..a3ee95acf9c 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); };