From e340b0002738f6dd6f5ccc833423d849c4ec6f4d Mon Sep 17 00:00:00 2001 From: kozbial Date: Tue, 17 Aug 2021 10:55:03 -0700 Subject: [PATCH] clang-format core/metrics_manager.js --- core/flyout_metrics_manager.js | 3 +-- core/metrics_manager.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/core/flyout_metrics_manager.js b/core/flyout_metrics_manager.js index 23a04a2be..b3ed243d6 100644 --- a/core/flyout_metrics_manager.js +++ b/core/flyout_metrics_manager.js @@ -39,8 +39,7 @@ const FlyoutMetricsManager = function(workspace, flyout) { FlyoutMetricsManager.superClass_.constructor.call(this, workspace); }; -object.inherits( - FlyoutMetricsManager, MetricsManager); +object.inherits(FlyoutMetricsManager, MetricsManager); /** * Gets the bounding box of the blocks on the flyout's workspace. diff --git a/core/metrics_manager.js b/core/metrics_manager.js index ed36bdb09..ea90030e8 100644 --- a/core/metrics_manager.js +++ b/core/metrics_manager.js @@ -219,7 +219,8 @@ MetricsManager.prototype.getViewMetrics = function( if (toolboxPosition == toolbox.Position.TOP || toolboxPosition == toolbox.Position.BOTTOM) { svgMetrics.height -= toolboxMetrics.height; - } else if (toolboxPosition == toolbox.Position.LEFT || + } else if ( + toolboxPosition == toolbox.Position.LEFT || toolboxPosition == toolbox.Position.RIGHT) { svgMetrics.width -= toolboxMetrics.width; } @@ -227,7 +228,8 @@ MetricsManager.prototype.getViewMetrics = function( if (toolboxPosition == toolbox.Position.TOP || toolboxPosition == toolbox.Position.BOTTOM) { svgMetrics.height -= flyoutMetrics.height; - } else if (toolboxPosition == toolbox.Position.LEFT || + } else if ( + toolboxPosition == toolbox.Position.LEFT || toolboxPosition == toolbox.Position.RIGHT) { svgMetrics.width -= flyoutMetrics.width; } @@ -285,8 +287,7 @@ MetricsManager.prototype.hasFixedEdges = function() { * area. * @protected */ -MetricsManager.prototype.getComputedFixedEdges_ = function( - opt_viewMetrics) { +MetricsManager.prototype.getComputedFixedEdges_ = function(opt_viewMetrics) { if (!this.hasFixedEdges()) { // Return early if there are no edges. return {}; @@ -367,14 +368,13 @@ MetricsManager.prototype.getScrollMetrics = function( const paddedContent = this.getPaddedContent_(viewMetrics, contentMetrics); // Use combination of fixed bounds and padded content to make scroll area. - const top = fixedEdges.top !== undefined ? - fixedEdges.top : paddedContent.top; - const left = fixedEdges.left !== undefined ? - fixedEdges.left : paddedContent.left; - const bottom = fixedEdges.bottom !== undefined ? - fixedEdges.bottom : paddedContent.bottom; - const right = fixedEdges.right !== undefined ? - fixedEdges.right : paddedContent.right; + const top = fixedEdges.top !== undefined ? fixedEdges.top : paddedContent.top; + const left = + fixedEdges.left !== undefined ? fixedEdges.left : paddedContent.left; + const bottom = fixedEdges.bottom !== undefined ? fixedEdges.bottom : + paddedContent.bottom; + const right = + fixedEdges.right !== undefined ? fixedEdges.right : paddedContent.right; return { top: top / scale, @@ -439,7 +439,8 @@ MetricsManager.prototype.getMetrics = function() { const absoluteMetrics = this.getAbsoluteMetrics(); const viewMetrics = this.getViewMetrics(); const contentMetrics = this.getContentMetrics(); - const scrollMetrics = this.getScrollMetrics(false, viewMetrics, contentMetrics); + const scrollMetrics = + this.getScrollMetrics(false, viewMetrics, contentMetrics); return { contentHeight: contentMetrics.height, @@ -473,7 +474,6 @@ MetricsManager.prototype.getMetrics = function() { }; registry.register( - registry.Type.METRICS_MANAGER, registry.DEFAULT, - MetricsManager); + registry.Type.METRICS_MANAGER, registry.DEFAULT, MetricsManager); exports = MetricsManager;