itowns icon indicating copy to clipboard operation
itowns copied to clipboard

fix(PlanarControls): fix rounding issues with max and min resolution

Open mgermerie opened this issue 3 years ago • 1 comments

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 a PerspectiveCamera, the distance traveled does not strictly matches the value implied by the zoomFactor parameter. This imprecision causes the same issue as mentioned in #1659.

mgermerie avatar May 28 '21 14:05 mgermerie

@mgermerie could you refresh this PR?

gchoqueux avatar Sep 15 '22 09:09 gchoqueux