clay icon indicating copy to clipboard operation
clay copied to clipboard

[Question] Use same enumeration value for CLAY_TEXT_ALIGN and CLAY_ALIGN_X

Open pdoane opened this issue 8 months ago • 3 comments

Currently text alignment is left, center, right and layout alignment is left, right, center.

At a higher level I use the same enumeration value for both text alignment and layout X alignment and was hoping to just cast directly to the Clay value (with static assert to make sure they match).

Not a big deal as I can translate but maybe it's good for these to line up? Or maybe the different value was intentional?

pdoane avatar May 01 '25 19:05 pdoane

Good question! I agree that having a reusable enum for alignment would be useful, however I'm not 100% sure that they will stay exactly in sync, as later down the line we may add the justified option for text x alignment:

Image

nicbarker avatar May 02 '25 04:05 nicbarker

Justified could be a useful for child alignment too - effectively inserting an empty element with grow sizing in between.

pdoane avatar May 02 '25 05:05 pdoane

That's a very good point! I think you're probably right in that there will always be utility in these two alignments having the same available values, I'll make that change 🙂

nicbarker avatar May 06 '25 00:05 nicbarker