Files
Aaron Dodson 6b07ccab96 chore: Remove declareLegacyNamespace from renderers (#5528)
* chore: Remove declareLegacyNamespace from Geras renderer

* chore: Remove declareLegacyNamespace from minimalist renderer

* chore: Remove declareLegacyNamespace from thrasos renderer

* chore: Remove declareLegacyNamespace from zelos renderer

* fix: Move debugger functionality out of Blockly.blockRendering to avoid dependency cycle when re-exporting submodules

* chore: Remove declareLegacyNamespace from Blockly.blockRendering.*
2021-09-24 08:33:35 -07:00

45 lines
1.4 KiB
JavaScript

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Base class representing the space a connection takes up during
* rendering.
* @author fenichel@google.com (Rachel Fenichel)
*/
goog.module('Blockly.blockRendering.Connection');
/* eslint-disable-next-line no-unused-vars */
const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider');
const Measurable = goog.require('Blockly.blockRendering.Measurable');
/* eslint-disable-next-line no-unused-vars */
const RenderedConnection = goog.requireType('Blockly.RenderedConnection');
const Types = goog.require('Blockly.blockRendering.Types');
const object = goog.require('Blockly.utils.object');
/**
* The base class to represent a connection and the space that it takes up on
* the block.
* @param {!ConstantProvider} constants The rendering
* constants provider.
* @param {!RenderedConnection} connectionModel The connection object on
* the block that this represents.
* @package
* @constructor
* @extends {Measurable}
*/
const Connection = function(constants, connectionModel) {
Connection.superClass_.constructor.call(this, constants);
this.connectionModel = connectionModel;
this.shape = this.constants_.shapeFor(connectionModel);
this.isDynamicShape = !!this.shape['isDynamic'];
this.type |= Types.CONNECTION;
};
object.inherits(Connection, Measurable);
exports = Connection;