mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 21:20:12 +00:00
Remove magic 10% scale on numeric widget step (#643)
There are external code still dependent on the fact that Widget.options.step is scaled 10x, so the 10x-ed value is still kept there, while we use the new unscaled step2 within our code now. Ref: https://cs.comfy.org/search?q=context:global+%22step+/+10%22&patternType=keyword&sm=0
This commit is contained in:
10
src/utils/widget.ts
Normal file
10
src/utils/widget.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { IWidgetOptions } from "@/types/widgets"
|
||||
|
||||
/**
|
||||
* The step value for numeric widgets.
|
||||
* Use {@link IWidgetOptions.step2} if available, otherwise fallback to
|
||||
* {@link IWidgetOptions.step} which is scaled up by 10x in the legacy frontend logic.
|
||||
*/
|
||||
export function getWidgetStep(options: IWidgetOptions<unknown>): number {
|
||||
return options.step2 || ((options.step || 10) * 0.1)
|
||||
}
|
||||
Reference in New Issue
Block a user