fix: preserve legacy p-rec-annot elevation quotient formatting

This commit is contained in:
codex
2026-08-07 09:32:11 +03:00
parent a8749ffa69
commit f9cd0a43bf
3 changed files with 11 additions and 8 deletions
@@ -6,8 +6,11 @@ public static class LegacyElevationFormatter
{
public static int RoundModelElevation(double modelZ, double datumOffset)
{
var increments = Math.Round((modelZ + datumOffset) / 5d, MidpointRounding.AwayFromZero);
return checked((int)Math.Round(increments * 5d, MidpointRounding.AwayFromZero));
// InsertElevation.BlockJig divides the model-space ordinate by five,
// rounds that quotient away from zero, then formats the resulting
// integer as a signed metres/millimetres value. It does not multiply
// the rounded quotient back by five.
return checked((int)Math.Round((modelZ + datumOffset) / 5d, MidpointRounding.AwayFromZero));
}
public static string FormatMillimetres(int millimetres)