fix interpolation for alphabetic

This commit is contained in:
Kseniia 2021-01-15 19:35:20 +02:00
parent b57b7ef268
commit d25981a18d

View file

@ -116,14 +116,17 @@ public class Building extends MapObject {
String sname = getName2(); String sname = getName2();
if (getInterpolationType() == BuildingInterpolation.ALPHABETIC && num == numB) { if (getInterpolationType() == BuildingInterpolation.ALPHABETIC && num == numB) {
char ch = hno.charAt(hno.length() - 1); char hCh = hno.charAt(hno.length() - 1);
char chF = fname.charAt(fname.length() - 1); char fCh = fname.charAt(fname.length() - 1);
char chS = sname.charAt(sname.length() - 1); char sCh = sname.charAt(sname.length() - 1);
if (chS < chF && chF < ch) { int h = Character.getNumericValue(hCh);
return -1; int f = Character.getNumericValue(fCh);
int s = Character.getNumericValue(sCh);
if (sCh > fCh) {
return ((float) h - f) / (((float) s - f));
} }
if (chS > chF && ch < chF) { if (sCh < fCh) {
return -1; return ((float) f - h) / (((float) f - s));
} }
} }
if (num >= numB) { if (num >= numB) {