1
0
Fork 0

chore(core): Keep defaults in config.mjs

This commit is contained in:
Joost De Cock 2022-09-09 20:29:31 +02:00
parent 0cbffd6dc6
commit c72c1ec485
3 changed files with 26 additions and 22 deletions

View file

@ -16,6 +16,7 @@ import { Svg } from './svg.mjs'
import { Store } from './store.mjs'
import { Hooks } from './hooks.mjs'
import { version } from '../data.mjs'
import { loadPatternDefaults } from './config.mjs'
export function Pattern(config) {
// Non-enumerable properties
@ -824,19 +825,7 @@ Pattern.prototype.getRenderProps = function () {
// Merges settings object with default settings
Pattern.prototype.__applySettings = function (settings) {
this.settings = {
complete: true,
idPrefix: 'fs-',
locale: 'en',
units: 'metric',
margin: 2,
scale: 1,
layout: true,
debug: false,
options: {},
absoluteOptions: {},
...settings
}
this.settings = { ...loadPatternDefaults(), ...settings }
return this
}