Skip to content

Commit

Permalink
feat: Allow customizing GRID_UNIT for the Zelos renderer. (#8636)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko authored Nov 7, 2024
1 parent d804c1a commit 8f22286
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/renderers/zelos/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,19 @@ export class ConstantProvider extends BaseConstantProvider {
*/
SQUARED: Shape | null = null;

constructor() {
/**
* Creates a new ConstantProvider.
*
* @param gridUnit If set, defines the base unit used to calculate other
* constants.
*/
constructor(gridUnit?: number) {
super();

if (gridUnit) {
this.GRID_UNIT = gridUnit;
}

this.SMALL_PADDING = this.GRID_UNIT;

this.MEDIUM_PADDING = 2 * this.GRID_UNIT;
Expand Down

0 comments on commit 8f22286

Please sign in to comment.