DxP escribió: 04 Oct 2020, 16:30
AlainProvist escribió: 03 Oct 2020, 13:25
Yes because 66 is 2 (left align) | 64 (vertical centered) same for 69 which is 64 | 4 (right centered) | 1 (doesn't matter wether 1 or 0) and same for 72 which is 8 (horizontal centered) | 64
Can you this more explain?
I don't know how well you master bitfields in programming, but to make this simple it's a way to store multiple values into a single integer number. Generally the subvalues are bool values so each bit represents a bool. Now in this particular case they chose to put each possible alignment value in a separate bit, which is a bit weird because you can't possibly want to be left and right aligned at the same time

. But theoretically with separate bits for both, you could ask that.
The bitfield is the following one first (lowest) bit is usused. 2nd bit is for left align, 3rd for right align, 4th for horizontal center. Then 5th for top align, 6th for bottom align, and 7th for vertical center.
So in binary if you want something left aligned and vertically centered it will be 01000010 (from highest bit to lowest bit) which is in decimal 66. As the first bit is never used, it could be 01000011 (67) too.
Hope it's more clear now.
Edit: To go a "bit" further :p The code is using masks with & and | operators to "select" or "filter" the alignement. a mask is simply the integer value containing specific bits to 1. This way you can "select" the bit from the bitfield you want: like value & 2 (00000010) to select the value related to the left aligned bit. If this operation does not returns 0, it means the bit is "on". They also do value & 112 (01110000) to filter out the horizontal alignement from the value. The | operator is here to concatenate bits in the value. That's why I was using | previously to explain the possible values.