From 8dee57146956c36e8bc1dab1c12bf9ae822e282e Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 8 Mar 2024 17:16:18 +0000 Subject: [PATCH] chore: make getters for grid attributes public and update inline docs (#7865) --- core/grid.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/core/grid.ts b/core/grid.ts index 28e460fa0..e495e220f 100644 --- a/core/grid.ts +++ b/core/grid.ts @@ -66,12 +66,26 @@ export class Grid { this.update(this.scale); } + /** + * Get the spacing of the grid points (in px). + * + * @returns The spacing of the grid points. + */ + getSpacing(): number { + return this.spacing; + } + /** Sets the length of the grid lines. */ setLength(length: number) { this.length = length; this.update(this.scale); } + /** Get the length of the grid lines (in px). */ + getLength(): number { + return this.length; + } + /** * Sets whether blocks should snap to the grid or not. * @@ -85,25 +99,14 @@ export class Grid { } /** - * Whether blocks should snap to the grid, based on the initial configuration. + * Whether blocks should snap to the grid. * * @returns True if blocks should snap, false otherwise. - * @internal */ shouldSnap(): boolean { return this.snapToGrid; } - /** - * Get the spacing of the grid points (in px). - * - * @returns The spacing of the grid points. - * @internal - */ - getSpacing(): number { - return this.spacing; - } - /** * Get the ID of the pattern element, which should be randomized to avoid * conflicts with other Blockly instances on the page.