We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getRelativeToSurfaceXY()
1 parent 87afe3e commit 2ada188Copy full SHA for 2ada188
1 file changed
packages/blockly/core/block_svg.ts
@@ -354,8 +354,8 @@ export class BlockSvg
354
* @returns Object with .x and .y properties in workspace coordinates.
355
*/
356
override getRelativeToSurfaceXY(): Coordinate {
357
- const layerManger = this.workspace.getLayerManager();
358
- if (!layerManger) {
+ const layerManager = this.workspace.getLayerManager();
+ if (!layerManager) {
359
throw new Error(
360
'Cannot calculate position because the workspace has not been appended',
361
);
@@ -371,7 +371,7 @@ export class BlockSvg
371
x += xy.x;
372
y += xy.y;
373
element = element.parentNode as SVGElement;
374
- } while (element && !layerManger.hasLayer(element));
+ } while (element && !layerManager.hasLayer(element));
375
}
376
return new Coordinate(x, y);
377
0 commit comments