mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
refactor!: allows previously internal constants to be configurable (#5897)
This commit is contained in:
@@ -19,13 +19,13 @@ const Events = goog.require('Blockly.Events');
|
||||
const Procedures = goog.require('Blockly.Procedures');
|
||||
const Variables = goog.require('Blockly.Variables');
|
||||
const Xml = goog.require('Blockly.Xml');
|
||||
const internalConstants = goog.require('Blockly.internalConstants');
|
||||
const xmlUtils = goog.require('Blockly.utils.xml');
|
||||
const {Align} = goog.require('Blockly.Input');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {BlockDefinition} = goog.requireType('Blockly.blocks');
|
||||
const {config} = goog.require('Blockly.config');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {FieldCheckbox} = goog.require('Blockly.FieldCheckbox');
|
||||
const {FieldLabel} = goog.require('Blockly.FieldLabel');
|
||||
@@ -959,8 +959,8 @@ const PROCEDURE_CALL_COMMON = {
|
||||
const block = xmlUtils.createElement('block');
|
||||
block.setAttribute('type', this.defType_);
|
||||
const xy = this.getRelativeToSurfaceXY();
|
||||
const x = xy.x + internalConstants.SNAP_RADIUS * (this.RTL ? -1 : 1);
|
||||
const y = xy.y + internalConstants.SNAP_RADIUS * 2;
|
||||
const x = xy.x + config.snapRadius * (this.RTL ? -1 : 1);
|
||||
const y = xy.y + config.snapRadius * 2;
|
||||
block.setAttribute('x', x);
|
||||
block.setAttribute('y', y);
|
||||
const mutation = this.mutationToDom();
|
||||
|
||||
Reference in New Issue
Block a user