itowns
itowns copied to clipboard
fix(PlanarControls): fix rounding issues with max and min resolution
Description
Fix some rounding issues concerning minResolution
and maxResolution
parameters.
due to some incorrect rounding, the user could be unable to zoom out to reach a resolution equals to the minResolution
parameter (or to zoom in to reach a resolution equals to the maxResolution
parameter).
To fix this, the following is done :
- The resolution values are all rounded up to 10 to the minus sixth meters.
- The
maxResolution
(which is the minimal value the resolution must take) is rounded bellow. - The
minResolution
(which is the maximal value the resolution must take) is rounded above. - The current view resolution is rounded bellow or above depending if it is compared to
maxResolution
or minResolution.
Motivation and Context
Closes #1659.
Left to do
- [ ] When zooming in or out in a
PlanarView
with aPerspectiveCamera
, the distance traveled does not strictly matches the value implied by thezoomFactor
parameter. This imprecision causes the same issue as mentioned in #1659.
@mgermerie could you refresh this PR?