From 57d6c40061ff4c3ea999e0085bc82310393a35a8 Mon Sep 17 00:00:00 2001 From: kozbial Date: Mon, 16 Aug 2021 18:05:02 -0700 Subject: [PATCH] clang-format core/renderers/measurables/rows.js --- core/renderers/measurables/bottom_row.js | 12 ++++-------- core/renderers/measurables/input_row.js | 10 ++++------ core/renderers/measurables/spacer_row.js | 12 ++++-------- core/renderers/measurables/top_row.js | 14 ++++++-------- 4 files changed, 18 insertions(+), 30 deletions(-) diff --git a/core/renderers/measurables/bottom_row.js b/core/renderers/measurables/bottom_row.js index d435bda88..37e80f6f2 100644 --- a/core/renderers/measurables/bottom_row.js +++ b/core/renderers/measurables/bottom_row.js @@ -36,8 +36,7 @@ const object = goog.require('Blockly.utils.object'); * @extends {Row} */ const BottomRow = function(constants) { - BottomRow.superClass_.constructor.call(this, - constants); + BottomRow.superClass_.constructor.call(this, constants); this.type |= Types.BOTTOM_ROW; /** @@ -69,16 +68,14 @@ const BottomRow = function(constants) { */ this.baseline = 0; }; -object.inherits(BottomRow, - Row); +object.inherits(BottomRow, Row); /** * Returns whether or not the bottom row has a left square corner. * @param {!BlockSvg} block The block whose bottom row this represents. * @return {boolean} Whether or not the bottom row has a left square corner. */ -BottomRow.prototype.hasLeftSquareCorner = function( - block) { +BottomRow.prototype.hasLeftSquareCorner = function(block) { return !!block.outputConnection || !!block.getNextBlock(); }; @@ -87,8 +84,7 @@ BottomRow.prototype.hasLeftSquareCorner = function( * @param {!BlockSvg} _block The block whose bottom row this represents. * @return {boolean} Whether or not the bottom row has a right square corner. */ -BottomRow.prototype.hasRightSquareCorner = function( - _block) { +BottomRow.prototype.hasRightSquareCorner = function(_block) { return true; }; diff --git a/core/renderers/measurables/input_row.js b/core/renderers/measurables/input_row.js index 72b0b18ea..587d8cb8b 100644 --- a/core/renderers/measurables/input_row.js +++ b/core/renderers/measurables/input_row.js @@ -39,8 +39,7 @@ const InputRow = function(constants) { */ this.connectedBlockWidths = 0; }; -object.inherits(InputRow, - Row); +object.inherits(InputRow, Row); /** * Inspect all subcomponents and populate all size properties on the row. @@ -56,10 +55,9 @@ InputRow.prototype.measure = function() { if (Types.isInput(elem)) { if (Types.isStatementInput(elem)) { connectedBlockWidths += elem.connectedBlockWidth; - } else if (Types.isExternalInput(elem) && - elem.connectedBlockWidth != 0) { - connectedBlockWidths += (elem.connectedBlockWidth - - elem.connectionWidth); + } else if (Types.isExternalInput(elem) && elem.connectedBlockWidth != 0) { + connectedBlockWidths += + (elem.connectedBlockWidth - elem.connectionWidth); } } if (!(Types.isSpacer(elem))) { diff --git a/core/renderers/measurables/spacer_row.js b/core/renderers/measurables/spacer_row.js index 3d87e250f..3956355cb 100644 --- a/core/renderers/measurables/spacer_row.js +++ b/core/renderers/measurables/spacer_row.js @@ -31,19 +31,15 @@ const object = goog.require('Blockly.utils.object'); * @extends {Row} */ const SpacerRow = function(constants, height, width) { - SpacerRow.superClass_.constructor.call(this, - constants); - this.type |= Types.SPACER | - Types.BETWEEN_ROW_SPACER; + SpacerRow.superClass_.constructor.call(this, constants); + this.type |= Types.SPACER | Types.BETWEEN_ROW_SPACER; this.width = width; this.height = height; this.followsStatement = false; this.widthWithConnectedBlocks = 0; - this.elements = [ - new InRowSpacer(this.constants_, width)]; + this.elements = [new InRowSpacer(this.constants_, width)]; }; -object.inherits(SpacerRow, - Row); +object.inherits(SpacerRow, Row); /** * @override diff --git a/core/renderers/measurables/top_row.js b/core/renderers/measurables/top_row.js index cbd5e9c0e..a1bcd82f6 100644 --- a/core/renderers/measurables/top_row.js +++ b/core/renderers/measurables/top_row.js @@ -69,8 +69,7 @@ const TopRow = function(constants) { */ this.connection = null; }; -object.inherits(TopRow, - Row); +object.inherits(TopRow, Row); /** * Returns whether or not the top row has a left square corner. @@ -78,13 +77,13 @@ object.inherits(TopRow, * @return {boolean} Whether or not the top row has a left square corner. */ TopRow.prototype.hasLeftSquareCorner = function(block) { - const hasHat = (block.hat ? - block.hat === 'cap' : this.constants_.ADD_START_HATS) && + const hasHat = + (block.hat ? block.hat === 'cap' : this.constants_.ADD_START_HATS) && !block.outputConnection && !block.previousConnection; const prevBlock = block.getPreviousBlock(); - return !!block.outputConnection || - hasHat || (prevBlock ? prevBlock.getNextBlock() == block : false); + return !!block.outputConnection || hasHat || + (prevBlock ? prevBlock.getNextBlock() == block : false); }; /** @@ -92,8 +91,7 @@ TopRow.prototype.hasLeftSquareCorner = function(block) { * @param {!BlockSvg} _block The block whose top row this represents. * @return {boolean} Whether or not the top row has a right square corner. */ -TopRow.prototype.hasRightSquareCorner = function( - _block) { +TopRow.prototype.hasRightSquareCorner = function(_block) { return true; };