Only switch to the next color once the distance is 0.01 above the allowed distance
The goal of this is to reduce color flickering noise due to floating number errors
This commit is contained in:
@@ -166,6 +166,7 @@ export class DragRulerRuler extends Ruler {
|
|||||||
if (!(this.draggedEntity.actor.data.type === "character" && game.settings.get(settingsKey, "alwaysShowSpeedForPCs")))
|
if (!(this.draggedEntity.actor.data.type === "character" && game.settings.get(settingsKey, "alwaysShowSpeedForPCs")))
|
||||||
return this.color;
|
return this.color;
|
||||||
}
|
}
|
||||||
|
distance = Math.round(distance * 100) / 100;
|
||||||
if (!this.dragRulerRanges)
|
if (!this.dragRulerRanges)
|
||||||
this.dragRulerRanges = getRangesFromSpeedProvider(this.draggedEntity);
|
this.dragRulerRanges = getRangesFromSpeedProvider(this.draggedEntity);
|
||||||
return getColorForDistanceAndToken(distance, this.draggedEntity, this.dragRulerRanges);
|
return getColorForDistanceAndToken(distance, this.draggedEntity, this.dragRulerRanges);
|
||||||
|
|||||||
Reference in New Issue
Block a user