linebender / xilem

An experimental Rust native UI framework
Apache License 2.0
3.55k stars 111 forks source link

masonry: More efficient set of PointerButtons. #334

Closed waywardmonkeys closed 1 month ago

waywardmonkeys commented 3 months ago

This brings code over from glazier for a set of PointerButtons that just uses a single value and bit flags rather than a HashSet.

waywardmonkeys commented 3 months ago

This builds upon #333. The comment that was removed in #333 from the code in Glazier about PointerButton::None needing to be zero was not brought back as it isn't accurately with the usage of a function to get the bit flag for each variant.

waywardmonkeys commented 1 month ago

This is done now, I think ... I didn't add tests, but probably will in the future. But right now, this code is barely even used! (But definitely should be used more.)