feat(core): Allow toAbs for non-snapped values too
This commit is contained in:
parent
264a441c35
commit
c5753abdc0
1 changed files with 20 additions and 12 deletions
|
@ -174,18 +174,26 @@ PatternDrafter.prototype.__createPartWithContext = function (name, set) {
|
||||||
PatternDrafter.prototype.__loadAbsoluteOptionsSet = function (set) {
|
PatternDrafter.prototype.__loadAbsoluteOptionsSet = function (set) {
|
||||||
for (const optionName in this.pattern.settings[set].options) {
|
for (const optionName in this.pattern.settings[set].options) {
|
||||||
const option = this.pattern.config.options[optionName]
|
const option = this.pattern.config.options[optionName]
|
||||||
if (
|
if (typeof option !== 'undefined' && option.toAbs instanceof Function) {
|
||||||
typeof option !== 'undefined' &&
|
if (typeof option.snap !== 'undefined') {
|
||||||
typeof option.snap !== 'undefined' &&
|
this.pattern.settings[set].absoluteOptions[optionName] = this.__snappedPercentageOption(
|
||||||
option.toAbs instanceof Function
|
optionName,
|
||||||
) {
|
set
|
||||||
this.pattern.settings[set].absoluteOptions[optionName] = this.__snappedPercentageOption(
|
)
|
||||||
optionName,
|
this.pattern.setStores[set].log.debug(
|
||||||
set
|
`🧲 Snapped __${optionName}__ to \`${this.pattern.settings[set].absoluteOptions[optionName]}\` for set __${set}__`
|
||||||
)
|
)
|
||||||
this.pattern.setStores[set].log.debug(
|
} else {
|
||||||
`🧲 Snapped __${optionName}__ to \`${this.pattern.settings[set].absoluteOptions[optionName]}\` for set __${set}__`
|
const abs = option.toAbs(
|
||||||
)
|
this.pattern.settings[set].options[optionName],
|
||||||
|
this.pattern.settings[set],
|
||||||
|
mergeOptions(this.pattern.settings[set], this.pattern.config.options)
|
||||||
|
)
|
||||||
|
this.pattern.settings[set].absoluteOptions[optionName] = abs
|
||||||
|
this.pattern.setStores[set].log.debug(
|
||||||
|
`🧮 Absolute value of \`${optionName}\` option is \`${abs}\` for set __${set}__`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue