From cdef09268397ccbff7d8b223b39f566bed37dcb2 Mon Sep 17 00:00:00 2001 From: Karan Purohit Date: Tue, 14 Feb 2017 23:00:14 +0530 Subject: [PATCH 1/2] Potential bug fix for issue #661 --- core/field_angle.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/field_angle.js b/core/field_angle.js index be88c27f7..758df2954 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -57,7 +57,7 @@ goog.inherits(Blockly.FieldAngle, Blockly.FieldTextInput); * Round angles to the nearest 15 degrees when using mouse. * Set to 0 to disable rounding. */ -Blockly.FieldAngle.ROUND = 15; +Blockly.FieldAngle.ROUND = 1; /** * Half the width of protractor image. @@ -155,7 +155,8 @@ Blockly.FieldAngle.prototype.showEditor_ = function() { this.line_ = Blockly.utils.createSvgElement('line', {'x1': Blockly.FieldAngle.HALF, 'y1': Blockly.FieldAngle.HALF, - 'class': 'blocklyAngleLine'}, svg); + 'class': 'blocklyAngleLine', + 'style': 'pointer-events: none;'}, svg); // Draw markers around the edge. for (var angle = 0; angle < 360; angle += 15) { Blockly.utils.createSvgElement('line', { From 4a81623f8dcb80db6353ba7e9563d8733773fc13 Mon Sep 17 00:00:00 2001 From: Karan Purohit Date: Wed, 15 Feb 2017 14:33:20 +0530 Subject: [PATCH 2/2] Code correction from previous commit. Moved style to css.js and set ROUNDING=15; --- core/css.js | 3 ++- core/field_angle.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/css.js b/core/css.js index d00f9da74..1e630bfd3 100644 --- a/core/css.js +++ b/core/css.js @@ -397,7 +397,7 @@ Blockly.Css.CONTENT = [ '.blocklyFlyoutScrollbar {', 'z-index: 30;', '}', - + '.blocklyScrollbarHorizontal, .blocklyScrollbarVertical {', 'position: absolute;', 'outline: none;', @@ -464,6 +464,7 @@ Blockly.Css.CONTENT = [ 'stroke: #f00;', 'stroke-width: 2;', 'stroke-linecap: round;', + 'pointer-events: none;', '}', '.blocklyContextMenu {', diff --git a/core/field_angle.js b/core/field_angle.js index 758df2954..85f4c6a6f 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -57,7 +57,7 @@ goog.inherits(Blockly.FieldAngle, Blockly.FieldTextInput); * Round angles to the nearest 15 degrees when using mouse. * Set to 0 to disable rounding. */ -Blockly.FieldAngle.ROUND = 1; +Blockly.FieldAngle.ROUND = 15; /** * Half the width of protractor image. @@ -152,11 +152,11 @@ Blockly.FieldAngle.prototype.showEditor_ = function() { }, svg); this.gauge_ = Blockly.utils.createSvgElement('path', {'class': 'blocklyAngleGauge'}, svg); - this.line_ = Blockly.utils.createSvgElement('line', - {'x1': Blockly.FieldAngle.HALF, + this.line_ = Blockly.utils.createSvgElement('line',{ + 'x1': Blockly.FieldAngle.HALF, 'y1': Blockly.FieldAngle.HALF, 'class': 'blocklyAngleLine', - 'style': 'pointer-events: none;'}, svg); + }, svg); // Draw markers around the edge. for (var angle = 0; angle < 360; angle += 15) { Blockly.utils.createSvgElement('line', {