qgs3daxissettings: Correctly read viewport ratio on a saved project #54870
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When loading a project which contains a 3D view, the 3D axis is not visible even when it is supposed to be displayed. This is because the min and max viewport ratio settings are always equal to 0 on a saved project. Indeed, these settings are supposed to handle the 3D axis visibility when the 3D view size changes: the axis are hidden when the view becomes too small.
These ratio are stored as double between 0 and 1. However, the logic which reads these parameters from a saved
project (
Qgs3DAxisSettings::readXml
) parses them as integer. Therefore, the min and max ratio are always equal to 0. Then, the 3D axis visibility test is always false and the 3D axis are always hidden.This issue is fixed by changing
Qgs3DAxisSettings::readXml
to read the ratios as double.cc @benoitdm-oslandia