mirror of
https://github.com/google/blockly.git
synced 2026-01-13 11:57:10 +01:00
Use connection width to find empty input width
This commit is contained in:
@@ -108,13 +108,12 @@ Blockly.blockRendering.constants.SPACER_DEFAULT_HEIGHT = 15;
|
||||
|
||||
Blockly.blockRendering.constants.MIN_BLOCK_HEIGHT = 24;
|
||||
|
||||
Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_WIDTH =
|
||||
Blockly.blockRendering.constants.TAB_WIDTH + 14.5;
|
||||
Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_PADDING = 14.5;
|
||||
|
||||
Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_HEIGHT =
|
||||
Blockly.blockRendering.constants.TAB_HEIGHT + 11;
|
||||
|
||||
Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_WIDTH = 10;
|
||||
Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_PADDING = 2;
|
||||
|
||||
/**
|
||||
* The height of an empty statement input. Note that in the old rendering this
|
||||
|
||||
@@ -255,7 +255,8 @@ Blockly.blockRendering.InlineInput = function(input) {
|
||||
|
||||
if (!this.connectedBlock) {
|
||||
this.height = Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_HEIGHT;
|
||||
this.width = Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_WIDTH;
|
||||
this.width = this.connectionShape.width +
|
||||
Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_PADDING;
|
||||
} else {
|
||||
// We allow the dark path to show on the parent block so that the child
|
||||
// block looks embossed. This takes up an extra pixel in both x and y.
|
||||
@@ -315,7 +316,8 @@ Blockly.blockRendering.ExternalValueInput = function(input) {
|
||||
this.height =
|
||||
this.connectedBlockHeight - 2 * Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP;
|
||||
}
|
||||
this.width = Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_WIDTH;
|
||||
this.width = this.connectionShape.width +
|
||||
Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_PADDING;
|
||||
|
||||
this.connectionOffsetY = Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP;
|
||||
this.connectionHeight = this.connectionShape.height;
|
||||
|
||||
Reference in New Issue
Block a user