The functions:
* AddPaddingRow
* StartRowWithPadding
* StartRow
* AddPaddingColumn
* AddColumn
in GridLayout (chromium/src/ui/views/grid_layout.h) receives a parameter that defines how much the view should scale. The parameter is a float and is almost every time passed as 0 or 1, but there are cases where it is 0.5 or 100. This parameter is sometimes passed as variable, locally defined as:
constexpr float kStretchy = 1.f
constexpr float kFixed = 0.f
but most often as a magic constant.
The inconsistent usage makes it hard to understand how the parameter should be used and what is does. This could be solved by defining kStretchy and kFixed in the namespace views::GridLayout and use it instead of magic constants.
Patch incoming.
Comment 1 by bugdroid1@chromium.org
, Jun 27 2018