From 868d3cf30fead1dcc99350f6b82aaba34b5db267 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 24 Feb 2020 11:13:05 -0800 Subject: [PATCH] Fix geras collapsed rendering incorrect in RTL (#3709) --- core/renderers/geras/highlight_constants.js | 6 ++++-- core/renderers/geras/highlighter.js | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/renderers/geras/highlight_constants.js b/core/renderers/geras/highlight_constants.js index a8502a9d2..a986c9e35 100644 --- a/core/renderers/geras/highlight_constants.js +++ b/core/renderers/geras/highlight_constants.js @@ -53,7 +53,7 @@ Blockly.geras.HighlightConstantProvider = function(constants) { * @package */ Blockly.geras.HighlightConstantProvider.prototype.init = function() { - + /** * An object containing sizing and path information about inside corner * highlights. @@ -273,7 +273,9 @@ Blockly.geras.HighlightConstantProvider.prototype.makeJaggedTeeth = function() { Blockly.utils.svgPaths.moveBy(-10.2, 6.8) + Blockly.utils.svgPaths.lineTo(5.1, 2.6); return { - pathLeft: pathLeft + pathLeft: pathLeft, + height: 12, + width: 10.2 }; }; diff --git a/core/renderers/geras/highlighter.js b/core/renderers/geras/highlighter.js index b496b4897..811c0e16b 100644 --- a/core/renderers/geras/highlighter.js +++ b/core/renderers/geras/highlighter.js @@ -110,11 +110,10 @@ Blockly.geras.Highlighter.prototype.drawTopCorner = function(row) { Blockly.geras.Highlighter.prototype.drawJaggedEdge_ = function(row) { if (this.info_.RTL) { - this.steps_ += Blockly.utils.svgPaths.lineOnAxis('H', row.width - this.highlightOffset_); - this.steps_ += this.jaggedTeethPaths_.pathLeft; var remainder = row.height - this.jaggedTeethPaths_.height - this.highlightOffset_; - this.steps_ += Blockly.utils.svgPaths.lineOnAxis('v', remainder); + this.steps_ += this.jaggedTeethPaths_.pathLeft + + Blockly.utils.svgPaths.lineOnAxis('v', remainder); } };