Files
blockly/core/renderers/measurables/base.js
Aaron Dodson 18283e816f Migrate core/renderers/measurables/base.js to goog.module syntax (#5308)
* Migrate core/renderers/measurables/base.js to goog.module

* Migrate core/renderers/measurables/base.js to named requires
2021-08-11 08:11:44 -07:00

50 lines
1.2 KiB
JavaScript

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Methods for graphically rendering a block as SVG.
* @author fenichel@google.com (Rachel Fenichel)
*/
'use strict';
goog.module('Blockly.blockRendering.Measurable');
goog.module.declareLegacyNamespace();
/* eslint-disable-next-line no-unused-vars */
const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider');
const Types = goog.require('Blockly.blockRendering.Types');
/**
* The base class to represent a part of a block that takes up space during
* rendering. The constructor for each non-spacer Measurable records the size
* of the block element (e.g. field, statement input).
* @param {!ConstantProvider} constants The rendering
* constants provider.
* @package
* @constructor
*/
const Measurable = function(constants) {
this.width = 0;
this.height = 0;
this.type = Types.NONE;
this.xPos = 0;
this.centerline = 0;
/**
* The renderer's constant provider.
* @type {!ConstantProvider}
* @protected
*/
this.constants_ = constants;
this.notchOffset = this.constants_.NOTCH_OFFSET_LEFT;
};
exports = Measurable;