Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use correct namespace for svgMath functions #5813

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports.isTargetInput = isTargetInput;
const getRelativeXY = function(element) {
deprecation.warn(
'Blockly.utils.getRelativeXY', 'December 2021', 'December 2022',
'Blockly.svgMath.getRelativeXY');
'Blockly.utils.svgMath.getRelativeXY');
return svgMath.getRelativeXY(element);
};
exports.getRelativeXY = getRelativeXY;
Expand All @@ -128,7 +128,7 @@ exports.getRelativeXY = getRelativeXY;
const getInjectionDivXY = function(element) {
deprecation.warn(
'Blockly.utils.getInjectionDivXY_', 'December 2021', 'December 2022',
'Blockly.svgMath.getInjectionDivXY');
'Blockly.utils.svgMath.getInjectionDivXY');
return svgMath.getInjectionDivXY(element);
};
exports.getInjectionDivXY_ = getInjectionDivXY;
Expand Down Expand Up @@ -261,7 +261,7 @@ exports.genUid = genUid;
const is3dSupported = function() {
deprecation.warn(
'Blockly.utils.is3dSupported', 'December 2021', 'December 2022',
'Blockly.svgMath.is3dSupported');
'Blockly.utils.svgMath.is3dSupported');
return svgMath.is3dSupported();
};
exports.is3dSupported = is3dSupported;
Expand All @@ -278,7 +278,7 @@ exports.is3dSupported = is3dSupported;
const getViewportBBox = function() {
deprecation.warn(
'Blockly.utils.getViewportBBox', 'December 2021', 'December 2022',
'Blockly.svgMath.getViewportBBox');
'Blockly.utils.svgMath.getViewportBBox');
return svgMath.getViewportBBox();
};
exports.getViewportBBox = getViewportBBox;
Expand Down Expand Up @@ -309,7 +309,7 @@ exports.arrayRemove = arrayRemove;
const getDocumentScroll = function() {
deprecation.warn(
'Blockly.utils.getDocumentScroll', 'December 2021', 'December 2022',
'Blockly.svgMath.getDocumentScroll');
'Blockly.utils.svgMath.getDocumentScroll');
return svgMath.getDocumentScroll();
};
exports.getDocumentScroll = getDocumentScroll;
Expand Down Expand Up @@ -344,7 +344,7 @@ exports.getBlockTypeCounts = getBlockTypeCounts;
const screenToWsCoordinates = function(ws, screenCoordinates) {
deprecation.warn(
'Blockly.utils.screenToWsCoordinates', 'December 2021', 'December 2022',
'Blockly.svgMath.screenToWsCoordinates');
'Blockly.utils.svgMath.screenToWsCoordinates');
return svgMath.screenToWsCoordinates(ws, screenCoordinates);
};
exports.screenToWsCoordinates = screenToWsCoordinates;
Expand Down
12 changes: 6 additions & 6 deletions core/utils/svg_math.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const XY_STYLE_REGEX =
* its parent. Only for SVG elements and children (e.g. rect, g, path).
* @param {!Element} element SVG element to find the coordinates of.
* @return {!Coordinate} Object with .x and .y properties.
* @alias Blockly.svgMath.getRelativeXY
* @alias Blockly.utils.svgMath.getRelativeXY
*/
const getRelativeXY = function(element) {
const xy = new Coordinate(0, 0);
Expand Down Expand Up @@ -96,7 +96,7 @@ exports.getRelativeXY = getRelativeXY;
* not a child of the div Blockly was injected into, the behaviour is
* undefined.
* @return {!Coordinate} Object with .x and .y properties.
* @alias Blockly.svgMath.getInjectionDivXY
* @alias Blockly.utils.svgMath.getInjectionDivXY
*/
const getInjectionDivXY = function(element) {
let x = 0;
Expand All @@ -119,7 +119,7 @@ exports.getInjectionDivXY = getInjectionDivXY;
* Check if 3D transforms are supported by adding an element
* and attempting to set the property.
* @return {boolean} True if 3D transforms are supported.
* @alias Blockly.svgMath.is3dSupported
* @alias Blockly.utils.svgMath.is3dSupported
*/
const is3dSupported = function() {
if (is3dSupported.cached_ !== undefined) {
Expand Down Expand Up @@ -172,7 +172,7 @@ exports.is3dSupported = is3dSupported;
* scroll into account.
* @return {!Rect} An object containing window width, height, and
* scroll position in window coordinates.
* @alias Blockly.svgMath.getViewportBBox
* @alias Blockly.utils.svgMath.getViewportBBox
* @package
*/
const getViewportBBox = function() {
Expand All @@ -188,7 +188,7 @@ exports.getViewportBBox = getViewportBBox;
* Gets the document scroll distance as a coordinate object.
* Copied from Closure's goog.dom.getDocumentScroll.
* @return {!Coordinate} Object with values 'x' and 'y'.
* @alias Blockly.svgMath.getDocumentScroll
* @alias Blockly.utils.svgMath.getDocumentScroll
*/
const getDocumentScroll = function() {
const el = document.documentElement;
Expand All @@ -210,7 +210,7 @@ exports.getDocumentScroll = getDocumentScroll;
* @param {!Coordinate} screenCoordinates The screen coordinates to
* be converted to workspace coordinates
* @return {!Coordinate} The workspace coordinates.
* @alias Blockly.svgMath.screenToWsCoordinates
* @alias Blockly.utils.svgMath.screenToWsCoordinates
*/
const screenToWsCoordinates = function(ws, screenCoordinates) {
const screenX = screenCoordinates.x;
Expand Down