mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
[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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user