Fix geras collapsed rendering incorrect in RTL (#3709)

This commit is contained in:
Beka Westberg
2020-02-24 11:13:05 -08:00
committed by GitHub
parent fc78bf0a2b
commit 868d3cf30f
2 changed files with 6 additions and 5 deletions

View File

@@ -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
};
};

View File

@@ -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);
}
};