Files
blockly/core/renderers/measurables/hat.js
Aaron Dodson 3851b14627 refactor: Migrate to named exports (#5623)
* refactor: Migrate to named exports

* fix: Sort requires

* fix: Remove duplicate deps
2021-10-20 15:53:23 -07:00

46 lines
1.2 KiB
JavaScript

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Objects representing a hat in a row of a rendered
* block.
*/
/**
* Objects representing a hat in a row of a rendered
* block.
* @class
*/
goog.module('Blockly.blockRendering.Hat');
const object = goog.require('Blockly.utils.object');
/* eslint-disable-next-line no-unused-vars */
const {ConstantProvider} = goog.requireType('Blockly.blockRendering.ConstantProvider');
const {Measurable} = goog.require('Blockly.blockRendering.Measurable');
const {Types} = goog.require('Blockly.blockRendering.Types');
/**
* An object containing information about the space a hat takes up during
* rendering.
* @param {!ConstantProvider} constants The rendering
* constants provider.
* @package
* @constructor
* @extends {Measurable}
* @alias Blockly.blockRendering.Hat
*/
const Hat = function(constants) {
Hat.superClass_.constructor.call(this, constants);
this.type |= Types.HAT;
this.height = this.constants_.START_HAT.height;
this.width = this.constants_.START_HAT.width;
this.ascenderHeight = this.height;
};
object.inherits(Hat, Measurable);
exports.Hat = Hat;