mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
clang-format core/renderers/measurables/inputs.js
This commit is contained in:
@@ -34,24 +34,20 @@ const object = goog.require('Blockly.utils.object');
|
||||
* @extends {InputConnection}
|
||||
*/
|
||||
const ExternalValueInput = function(constants, input) {
|
||||
ExternalValueInput.superClass_.constructor.call(this,
|
||||
constants, input);
|
||||
ExternalValueInput.superClass_.constructor.call(this, constants, input);
|
||||
this.type |= Types.EXTERNAL_VALUE_INPUT;
|
||||
if (!this.connectedBlock) {
|
||||
this.height = this.shape.height;
|
||||
} else {
|
||||
this.height =
|
||||
this.connectedBlockHeight - this.constants_.TAB_OFFSET_FROM_TOP -
|
||||
this.constants_.MEDIUM_PADDING;
|
||||
this.height = this.connectedBlockHeight -
|
||||
this.constants_.TAB_OFFSET_FROM_TOP - this.constants_.MEDIUM_PADDING;
|
||||
}
|
||||
this.width = this.shape.width +
|
||||
this.constants_.EXTERNAL_VALUE_INPUT_PADDING;
|
||||
this.width = this.shape.width + this.constants_.EXTERNAL_VALUE_INPUT_PADDING;
|
||||
|
||||
this.connectionOffsetY = this.constants_.TAB_OFFSET_FROM_TOP;
|
||||
this.connectionHeight = this.shape.height;
|
||||
this.connectionWidth = this.shape.width;
|
||||
};
|
||||
object.inherits(ExternalValueInput,
|
||||
InputConnection);
|
||||
object.inherits(ExternalValueInput, InputConnection);
|
||||
|
||||
exports = ExternalValueInput;
|
||||
|
||||
@@ -34,8 +34,7 @@ const object = goog.require('Blockly.utils.object');
|
||||
* @extends {InputConnection}
|
||||
*/
|
||||
const InlineInput = function(constants, input) {
|
||||
InlineInput.superClass_.constructor.call(this,
|
||||
constants, input);
|
||||
InlineInput.superClass_.constructor.call(this, constants, input);
|
||||
this.type |= Types.INLINE_INPUT;
|
||||
|
||||
if (!this.connectedBlock) {
|
||||
@@ -48,10 +47,10 @@ const InlineInput = function(constants, input) {
|
||||
this.height = this.connectedBlockHeight;
|
||||
}
|
||||
|
||||
this.connectionHeight = !this.isDynamicShape ? this.shape.height :
|
||||
this.shape.height(this.height);
|
||||
this.connectionWidth = !this.isDynamicShape ? this.shape.width :
|
||||
this.shape.width(this.height);
|
||||
this.connectionHeight =
|
||||
!this.isDynamicShape ? this.shape.height : this.shape.height(this.height);
|
||||
this.connectionWidth =
|
||||
!this.isDynamicShape ? this.shape.width : this.shape.width(this.height);
|
||||
if (!this.connectedBlock) {
|
||||
this.width += this.connectionWidth * (this.isDynamicShape ? 2 : 1);
|
||||
}
|
||||
@@ -59,9 +58,9 @@ const InlineInput = function(constants, input) {
|
||||
this.shape.connectionOffsetY(this.connectionHeight) :
|
||||
this.constants_.TAB_OFFSET_FROM_TOP;
|
||||
this.connectionOffsetX = this.isDynamicShape ?
|
||||
this.shape.connectionOffsetX(this.connectionWidth) : 0;
|
||||
this.shape.connectionOffsetX(this.connectionWidth) :
|
||||
0;
|
||||
};
|
||||
object.inherits(InlineInput,
|
||||
InputConnection);
|
||||
object.inherits(InlineInput, InputConnection);
|
||||
|
||||
exports = InlineInput;
|
||||
|
||||
@@ -32,14 +32,15 @@ const object = goog.require('Blockly.utils.object');
|
||||
* @extends {Connection}
|
||||
*/
|
||||
const InputConnection = function(constants, input) {
|
||||
InputConnection.superClass_.constructor.call(this,
|
||||
constants, input.connection);
|
||||
InputConnection.superClass_.constructor.call(
|
||||
this, constants, input.connection);
|
||||
|
||||
this.type |= Types.INPUT;
|
||||
this.input = input;
|
||||
this.align = input.align;
|
||||
this.connectedBlock = input.connection && input.connection.targetBlock() ?
|
||||
input.connection.targetBlock() : null;
|
||||
input.connection.targetBlock() :
|
||||
null;
|
||||
|
||||
if (this.connectedBlock) {
|
||||
const bBox = this.connectedBlock.getHeightWidth();
|
||||
@@ -53,7 +54,6 @@ const InputConnection = function(constants, input) {
|
||||
this.connectionOffsetX = 0;
|
||||
this.connectionOffsetY = 0;
|
||||
};
|
||||
object.inherits(InputConnection,
|
||||
Connection);
|
||||
object.inherits(InputConnection, Connection);
|
||||
|
||||
exports = InputConnection;
|
||||
|
||||
@@ -34,8 +34,7 @@ const object = goog.require('Blockly.utils.object');
|
||||
* @extends {InputConnection}
|
||||
*/
|
||||
const StatementInput = function(constants, input) {
|
||||
StatementInput.superClass_.constructor.call(this,
|
||||
constants, input);
|
||||
StatementInput.superClass_.constructor.call(this, constants, input);
|
||||
this.type |= Types.STATEMENT_INPUT;
|
||||
|
||||
if (!this.connectedBlock) {
|
||||
@@ -48,7 +47,6 @@ const StatementInput = function(constants, input) {
|
||||
}
|
||||
this.width = this.constants_.STATEMENT_INPUT_NOTCH_OFFSET + this.shape.width;
|
||||
};
|
||||
object.inherits(StatementInput,
|
||||
InputConnection);
|
||||
object.inherits(StatementInput, InputConnection);
|
||||
|
||||
exports = StatementInput;
|
||||
|
||||
Reference in New Issue
Block a user