mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-11 08:20:53 +00:00
Add round option to floats
This commit is contained in:
@@ -170,7 +170,16 @@ function onCustomFloatCreated(this: LGraphNode) {
|
||||
if (this.properties.step) return this.properties.step
|
||||
|
||||
const { precision } = this.properties
|
||||
return typeof precision === 'number' ? 10 ** precision : 1
|
||||
return typeof precision === 'number' ? 5 * 10 ** -precision : 1
|
||||
},
|
||||
set: (v) => (this.properties.step = v)
|
||||
})
|
||||
Object.defineProperty(valueWidget.options, 'round', {
|
||||
get: () => {
|
||||
if (this.properties.round) return this.properties.round
|
||||
|
||||
const { precision } = this.properties
|
||||
return typeof precision === 'number' ? 10 ** -precision : 0.1
|
||||
},
|
||||
set: (v) => (this.properties.step = v)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user