Skip to content

Commit 746f135

Browse files
committed
✨ slider support steps/precision
1 parent 2cf6baa commit 746f135

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@litegraph-ts/core",
3-
"version": "0.2.22",
3+
"version": "0.2.23",
44
"description": "A graph node editor similar to PD or UDK Blueprints. It works in an HTML5 Canvas and allows to export graphs to be included in applications.",
55
"source": "src/index.ts",
66
"types": "src/index.ts",

packages/core/src/LGraphCanvas.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,7 @@ export default class LGraphCanvas
20702070
case "slider": {
20712071
const { max, min, step, precision } = w.options;
20722072
var range = max - min;
2073+
var old_value = w.value;
20732074

20742075
const calculateValue = (rawValue) => {
20752076
if (typeof step === "number" && step > 0) {
@@ -2085,7 +2086,7 @@ export default class LGraphCanvas
20852086
var raw_value = min + range * nvalue;
20862087
w.value = calculateValue(raw_value);
20872088

2088-
if (w.callback) {
2089+
if (old_value != w.value) {
20892090
setTimeout(function () {
20902091
inner_value_change(w, w.value);
20912092
}, 20);

0 commit comments

Comments
 (0)