mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
feat: Allow customizing GRID_UNIT for the Zelos renderer. (#8636)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user