[core] Check if frameZoom is NaN in Transform::flyTo callback
This commit is contained in:
@@ -36,6 +36,11 @@ TEST(Transform, InvalidZoom) {
|
||||
cameraOptions.center = LatLng { util::LATITUDE_MAX, util::LONGITUDE_MAX };
|
||||
cameraOptions.zoom = transform.getState().getMaxZoom();
|
||||
|
||||
// Executing flyTo with an empty size causes frameZoom to be NaN.
|
||||
transform.flyTo(cameraOptions);
|
||||
transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
|
||||
ASSERT_DOUBLE_EQ(transform.getZoom(), transform.getState().getMaxZoom());
|
||||
|
||||
// Executing flyTo with maximum zoom level to the same zoom level causes
|
||||
// frameZoom to be bigger than maximum zoom.
|
||||
transform.resize(Size { 100, 100 });
|
||||
|
||||
Reference in New Issue
Block a user