This commit builds up on the work done in #140790 for it to completely
eliminate header status text jump for commonly used operations
(translate, inset, shrink flatten and more), improving readability with
the new centered header introduced in #139507.
To achieve this, multiple modifications were made:
- In the main `unit_as_string` function, limit the width of numbers of
magnitude below 1 if fixed width is requested by passing a negative
`prec` parameter, previously only used for trailing zero (e.g., with
3 both 1.014 and 0.014 use the same decimal count, rather than 1.01
missing an extra digit).
- Due to the above change reducing precision for numbers with |val| < 1,
bump the overall precision for commonly used operations
(translate, bevel, inset and shrink/flatten) by 1.
- When precision mode (holding shift) is enabled during transform
operations, bump the displayed digit precision. This also has the
bonus advantage of acting as an extra visual indicator to know when
precision mode is enabled.
- Add a new `BLI_string_pad_number_sign` string util function, which
prepends positive numeric string with a [figure space character]
(https://en.wikipedia.org/wiki/Figure_space) to ensure they keep the
same length as their negative counterpart with the proportional font
used in the header.
The first modifications affects every part of Blender where conversion
of unit to string with trailing zeros preservation was previously used
(such as the depth eyedropper). The sign padding modification however
needs to be manually added to operators / transform operations on a
case by case basis as to not add empty minus sign padding in places
where it shouldn't be present.
Note that this commit removes jumping for *non-separated* unit
(None/Metric/Imperial *without* the Separate Units checkbox enabled in
the Scene unit settings), as separated unit (1m 50cm instead of 1.50m)
are bound to change width and cause jumps.
Pull Request: https://projects.blender.org/blender/blender/pulls/148574
When units were split into larger and smaller values, the larger
value is rounded and should not show trailing zeros.
Trailing zeros should only be used for the smaller unit.
Ref !140790
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069