[zelos] Add extra offset for statement input to account for right corner width (#3508)

* Add additional offset to the statement input in zelos to account for the width of right corner.

* inside corners
This commit is contained in:
Sam El-Husseini
2019-12-11 17:00:22 -08:00
committed by GitHub
parent bb5939f77c
commit adc06cc544
3 changed files with 15 additions and 1 deletions

View File

@@ -139,6 +139,13 @@ Blockly.blockRendering.ConstantProvider = function() {
*/
this.NOTCH_OFFSET_LEFT = 15;
/**
* Additional offset added to the statement input's width to account for the
* notch.
* @type {number}
*/
this.STATEMENT_INPUT_NOTCH_OFFSET = this.NOTCH_OFFSET_LEFT;
this.STATEMENT_BOTTOM_SPACER = 0;
this.STATEMENT_INPUT_PADDING_LEFT = 20;

View File

@@ -132,7 +132,7 @@ Blockly.blockRendering.StatementInput = function(constants, input) {
this.height =
this.connectedBlockHeight + this.constants_.STATEMENT_BOTTOM_SPACER;
}
this.width = this.constants_.NOTCH_OFFSET_LEFT + this.shape.width;
this.width = this.constants_.STATEMENT_INPUT_NOTCH_OFFSET + this.shape.width;
};
Blockly.utils.object.inherits(Blockly.blockRendering.StatementInput,
Blockly.blockRendering.InputConnection);

View File

@@ -80,6 +80,11 @@ Blockly.zelos.ConstantProvider = function() {
* @override
*/
this.NOTCH_OFFSET_LEFT = 3 * this.GRID_UNIT;
/**
* @override
*/
this.STATEMENT_INPUT_NOTCH_OFFSET = this.NOTCH_OFFSET_LEFT;
/**
* @override
@@ -373,6 +378,8 @@ Blockly.zelos.ConstantProvider.prototype.init = function() {
Blockly.zelos.ConstantProvider.superClass_.init.call(this);
this.HEXAGONAL = this.makeHexagonal();
this.ROUNDED = this.makeRounded();
this.STATEMENT_INPUT_NOTCH_OFFSET += this.INSIDE_CORNERS.rightWidth;
};
/**