mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
throttle work done on zoom and brush drag
This commit is contained in:
parent
e7b354e217
commit
985e3c43f9
2 changed files with 3 additions and 2 deletions
|
|
@ -573,6 +573,7 @@ function editHeightmap() {
|
|||
document.getElementById("brushesSliders").style.display = "none";
|
||||
}
|
||||
|
||||
const dragBrushThrottled = throttle(dragBrush, 100);
|
||||
function toggleBrushMode(e) {
|
||||
if (e.target.classList.contains("pressed")) {
|
||||
exitBrushMode();
|
||||
|
|
@ -581,7 +582,7 @@ function editHeightmap() {
|
|||
exitBrushMode();
|
||||
document.getElementById("brushesSliders").style.display = "block";
|
||||
e.target.classList.add("pressed");
|
||||
viewbox.style("cursor", "crosshair").call(d3.drag().on("start", dragBrush));
|
||||
viewbox.style("cursor", "crosshair").call(d3.drag().on("start", dragBrushThrottled));
|
||||
}
|
||||
|
||||
function dragBrush() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue