feat: Allow customizing GRID_UNIT for the Zelos renderer. (#8636)

This commit is contained in:
Aaron Dodson
2024-11-07 12:16:55 -08:00
committed by GitHub
parent d804c1a3c4
commit 8f2228658e

View File

@@ -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;