Fix: Re-fit OpSi globe swipes

This commit is contained in:
LmeSzinc 2023-05-25 22:32:45 +08:00
parent c6df09e170
commit 6487e460fa
2 changed files with 4 additions and 0 deletions

View File

@ -329,6 +329,8 @@ class ManualConfig:
'distance': 35,
'wlen': 500,
}
# On minitouch, Screen swipe (200, 200) = Map swipe (382, 442)
OS_GLOBE_SWIPE_MULTIPLY = (1.91, 2.21)
"""
module.retire

View File

@ -162,6 +162,8 @@ class GlobeCamera(GlobeOperation, ZoneManager):
area = (400, 200, GLOBE_MAP_SHAPE[0] - 400, GLOBE_MAP_SHAPE[1] - 250)
loca = point_limit(zone.location, area=area)
vector = np.array(loca) - self.globe_camera
# TODO: Yeah, 0.8 multiplier is shit, better implement needed
vector = vector * 0.8 / self.config.OS_GLOBE_SWIPE_MULTIPLY
swipe = tuple(np.min([np.abs(vector), swipe_limit], axis=0) * np.sign(vector))
self.globe_swipe(swipe)