Browse Source

修复地图点位计算错误

Frankensteinly 9 tháng trước cách đây
mục cha
commit
702721af8d

+ 2 - 2
app/src/main/java/com/grkj/iscs/view/widget/CustomMarkLayer.kt

@@ -87,7 +87,7 @@ class CustomMarkLayer @JvmOverloads constructor(
                         }
                     } else {    // 奇数个
                         if (j + 1 <= list.size / 2) {
-                            pointList[i].pos.x - icon.width * (list.size / 2) / currentZoom
+                            pointList[i].pos.x - icon.width * (list.size / 2 - j) / currentZoom
                         } else {
                             pointList[i].pos.x + icon.width * (j - list.size / 2) / currentZoom
                         }
@@ -195,7 +195,7 @@ class CustomMarkLayer @JvmOverloads constructor(
                                     }
                                 } else {    // 奇数个
                                     if (j + 1 <= list.size / 2) {
-                                        goal[0] - icon.width * (list.size / 2 + 0.5f)
+                                        goal[0] - icon.width * (list.size / 2 - j + 0.5f)
                                     } else {
                                         goal[0] + icon.width * (j - list.size / 2 - 0.5f)
                                     }