From 4f2b68efde7c1520e66ae580beb2b83902f5a43a Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 14 Apr 2016 12:39:14 -0400 Subject: [PATCH 1/3] Separate CORNER_RADIUS from BLOCK_MARGIN --- core/flyout.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/flyout.js b/core/flyout.js index 2e3ece5919..13ac3fef86 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -112,6 +112,13 @@ Blockly.Flyout.prototype.autoClose = true; */ Blockly.Flyout.prototype.CORNER_RADIUS = 8; +/** + * Corner radius of the flyout background. + * @type {number} + * @const + */ +Blockly.Flyout.prototype.BLOCK_MARGIN = 8; + /** * Top/bottom padding between scrollbar and edge of flyout background. * @type {number} @@ -572,7 +579,7 @@ Blockly.Flyout.prototype.show = function(xmlList) { Blockly.Procedures.flyoutCategory(this.workspace_.targetWorkspace); } - var margin = this.CORNER_RADIUS; + var margin = this.BLOCK_MARGIN; // Create the blocks to be shown in this flyout. var blocks = []; var gaps = []; @@ -1047,7 +1054,7 @@ Blockly.Flyout.terminateDrag_ = function() { Blockly.Flyout.prototype.reflowHorizontal = function() { this.workspace_.scale = this.targetWorkspace_.scale; var flyoutHeight = 0; - var margin = this.CORNER_RADIUS; + var margin = this.BLOCK_MARGIN; var blocks = this.workspace_.getTopBlocks(false); for (var x = 0, block; block = blocks[x]; x++) { var height = block.getHeightWidth().height; @@ -1081,7 +1088,7 @@ Blockly.Flyout.prototype.reflowHorizontal = function() { Blockly.Flyout.prototype.reflowVertical = function() { this.workspace_.scale = this.targetWorkspace_.scale; var flyoutWidth = 0; - var margin = this.CORNER_RADIUS; + var margin = this.BLOCK_MARGIN; var blocks = this.workspace_.getTopBlocks(false); for (var x = 0, block; block = blocks[x]; x++) { var width = block.getHeightWidth().width; From db0d086a11af4a01a1d946abb6736d3517d4f4fe Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 14 Apr 2016 12:39:27 -0400 Subject: [PATCH 2/3] Set flyout CORNER_RADIUS to 0 by default --- core/flyout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout.js b/core/flyout.js index 13ac3fef86..769f813602 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -110,7 +110,7 @@ Blockly.Flyout.prototype.autoClose = true; * @type {number} * @const */ -Blockly.Flyout.prototype.CORNER_RADIUS = 8; +Blockly.Flyout.prototype.CORNER_RADIUS = 0; /** * Corner radius of the flyout background. From dfdf1bb9b65badca3da86d2716d432a777daf983 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 14 Apr 2016 17:58:11 -0400 Subject: [PATCH 3/3] Fix comment --- core/flyout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout.js b/core/flyout.js index 769f813602..076768f5d7 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -113,7 +113,7 @@ Blockly.Flyout.prototype.autoClose = true; Blockly.Flyout.prototype.CORNER_RADIUS = 0; /** - * Corner radius of the flyout background. + * Margin of blocks in the flyout. * @type {number} * @const */