mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
Migrate core/utils/size.js to goog.module
This commit is contained in:
committed by
Christopher Allen
parent
bbb5b91ab3
commit
f6adf865f2
@@ -13,10 +13,11 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @name Blockly.utils.Size
|
||||
* @name Size
|
||||
* @namespace
|
||||
*/
|
||||
goog.provide('Blockly.utils.Size');
|
||||
goog.module('Blockly.utils.Size');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ goog.provide('Blockly.utils.Size');
|
||||
* @struct
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.utils.Size = function(width, height) {
|
||||
const Size = function(width, height) {
|
||||
/**
|
||||
* Width
|
||||
* @type {number}
|
||||
@@ -42,12 +43,12 @@ Blockly.utils.Size = function(width, height) {
|
||||
|
||||
/**
|
||||
* Compares sizes for equality.
|
||||
* @param {?Blockly.utils.Size} a A Size.
|
||||
* @param {?Blockly.utils.Size} b A Size.
|
||||
* @param {?Size} a A Size.
|
||||
* @param {?Size} b A Size.
|
||||
* @return {boolean} True iff the sizes have equal widths and equal
|
||||
* heights, or if both are null.
|
||||
*/
|
||||
Blockly.utils.Size.equals = function(a, b) {
|
||||
Size.equals = function(a, b) {
|
||||
if (a == b) {
|
||||
return true;
|
||||
}
|
||||
@@ -56,3 +57,5 @@ Blockly.utils.Size.equals = function(a, b) {
|
||||
}
|
||||
return a.width == b.width && a.height == b.height;
|
||||
};
|
||||
|
||||
exports = Size;
|
||||
|
||||
@@ -187,7 +187,7 @@ goog.addDependency('../../core/utils/math.js', ['Blockly.utils.math'], [], {'lan
|
||||
goog.addDependency('../../core/utils/metrics.js', ['Blockly.utils.Metrics'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/object.js', ['Blockly.utils.object'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/rect.js', ['Blockly.utils.Rect'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/size.js', ['Blockly.utils.Size'], []);
|
||||
goog.addDependency('../../core/utils/size.js', ['Blockly.utils.Size'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/string.js', ['Blockly.utils.string'], []);
|
||||
goog.addDependency('../../core/utils/style.js', ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/svg.js', ['Blockly.utils.Svg'], []);
|
||||
|
||||
Reference in New Issue
Block a user