Refactored field utilities.

This commit is contained in:
Beka Westberg
2019-08-08 10:45:01 -07:00
parent f539dbe6f6
commit cdc90f4059
21 changed files with 214 additions and 165 deletions

View File

@@ -31,6 +31,7 @@ goog.require('Blockly.Events');
goog.require('Blockly.Events.BlockMove');
goog.require('Blockly.InsertionMarkerManager');
goog.require('Blockly.utils.Coordinate');
goog.require('Blockly.utils.dom');
/**
@@ -164,7 +165,7 @@ Blockly.BlockDragger.prototype.startBlockDrag = function(currentDragDeltaXY,
// During a drag there may be a lot of rerenders, but not field changes.
// Turn the cache on so we don't do spurious remeasures during the drag.
Blockly.Field.startCache();
Blockly.utils.dom.startTextWidthCache();
this.workspace_.setResizesEnabled(false);
Blockly.blockAnimations.disconnectUiStop();
@@ -225,7 +226,7 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
this.dragBlock(e, currentDragDeltaXY);
this.dragIconData_ = [];
Blockly.Field.stopCache();
Blockly.utils.dom.stopTextWidthCache();
Blockly.blockAnimations.disconnectUiStop();