Skip to content

Commit 1944fbf

Browse files
authored
Merge pull request #416 from DCMLab/fix_curvature_lag
Fix curvature lag
2 parents 79223e8 + 709b282 commit 1944fbf

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/js/events/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class EventsManager {
9090
}
9191

9292
// touchend, mouseup
93-
onTapEnd() {
93+
onTapEnd(e) {
94+
this.app.ui?.relationCurvature?.onTapEnd(e)
9495
this.app.ui?.onTapEnd()
9596
}
9697

src/js/modules/UI/RelationWidth/index.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@ class RelationCurvature {
1010

1111
const { min, max, value } = this.input
1212
this.progressBar = new Progress('relation-width', { min, max, value })
13-
14-
this.throttling = false
1513
}
1614

1715
onInput({ target }) {
18-
if (target != this.input || this.throttling) {
16+
if (target != this.input) {
1917
return
2018
}
19+
const value = target.value
20+
this.progressBar.update(value)
21+
}
2122

22-
this.throttling = true
23+
onTapEnd({ target }) {
24+
if (target != this.input) {
25+
return
26+
}
2327

24-
requestAnimationFrame(() => {
25-
const value = target.value
26-
this.progressBar.update(value)
27-
handle_curvature_controller(value)
28-
adjustAllLayersSvgDimensions()
29-
this.throttling = false
30-
})
28+
const value = target.value
29+
this.progressBar.update(value)
30+
handle_curvature_controller(value)
31+
adjustAllLayersSvgDimensions()
3132
}
3233
}
3334

0 commit comments

Comments
 (0)