Round coords when adding point
This commit is contained in:
parent
1079a13836
commit
6d58284119
@ -1452,8 +1452,8 @@ function updatePointWhenDragged(pointID) {
|
||||
if (points[i].id === dragDropPointID) {
|
||||
selectedPoint = points[i];
|
||||
let [newHeat, newHumidity] = canvasPixelCoordsToBiomeCoords(event.offsetX, event.offsetY);
|
||||
selectedPoint.heat = newHeat;
|
||||
selectedPoint.humidity = newHumidity;
|
||||
selectedPoint.heat = Math.round(newHeat);
|
||||
selectedPoint.humidity = Math.round(newHumidity);
|
||||
draw(true);
|
||||
updateWidgetStates();
|
||||
let [elemID, elem] = getSelectedBiomeIDAndElement();
|
||||
@ -1763,6 +1763,8 @@ voronoiCanvas.ondblclick = function(event) {
|
||||
return;
|
||||
}
|
||||
let [he, hu] = canvasPixelCoordsToBiomeCoords(event.offsetX, event.offsetY);
|
||||
he = Math.round(he);
|
||||
hu = Math.round(hu);
|
||||
addBiome({name: generateBiomeName(lastBiomeID), heat:he, humidity: hu, min_y:MIN_Y_DEFAULT, max_y:MAX_Y_DEFAULT});
|
||||
}
|
||||
voronoiCanvas.onmouseup = function(event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user