OZtree icon indicating copy to clipboard operation
OZtree copied to clipboard

Jumping to a place that's already very close by

Open jrosindell opened this issue 6 years ago • 3 comments

When a jump is requested to a place that's really nearby it should not take place. This was mentioned in #55 and a fix was attempted in controller_loc.js but it doesn't seem to be working.

jrosindell avatar Sep 14 '19 11:09 jrosindell

There already seems to be code for this in Controller.prototype.perform_flight_transition - or at least, it says "@return {boolean} returns false if the distance to codein_fly is too short so there is no animation performed.". So I wonder if we have redundantly coded up another version, which is not working?

hyanwong avatar Sep 14 '19 15:09 hyanwong

The code pointed to by Yan was specifically for a flight animation, we want to do the same for jumping and ideally without reimplementing in two places a function that defines 'close by'

jrosindell avatar Sep 14 '19 19:09 jrosindell

I think this has since been fixed with https://github.com/OneZoom/OZtree/commit/845382d065a37cecb10b190abcb4cf6c5b666a41

The "close enough" logic is in perform_actual_fly:

https://github.com/OneZoom/OZtree/blob/edcd6408065d5e2ba3bb25b1b735032c4844806b/OZprivate/rawJS/OZTreeModule/src/position_helper.js#L246-L251

The commit above re-implements leaps by flying as fast as feasibly possible to a location. By doing so the "close enough" behaviour is now shared.

lentinj avatar May 17 '22 10:05 lentinj