-
-
Notifications
You must be signed in to change notification settings - Fork 201
Description
Currently both Surface and Rect support .width, .height, and .size. Masks do not. Supporting there parameters would go a long way to bridging the gap between Masks and and the other types.
Further Surfaces currently support the .get_bounding_rect() function whereas Masks support the .get_bounding_rects() functions. It would be best to allow both Masks and Surfaces to have access to each of these functions. This would allow for more generic functions to be created that are much simpler to use overall. For instance a single function which accepts Masks and/or Surfaces to return bounding Rects without type checks and so forth. Further it would allow both Masks and Surfaces more opportunities to be placed in single data structures such as lists etc when the use case is type agnostic.
Further improvement suggestions for the .get_bounding_rect(s)() functions are adding options to return FRects and also adding support for bounding by colorkey or set/unset bits.
On the topic of Mask, they seem a prime candidate for bitwise operators and implementing pythonic dunder support for & ^ * + - etc. I believe Mask XORing could be a really winner in many instances. Some of these features already exists but are their behaviors are not tied to the dunder functions.
Anyways. I'll leave it at that. Please reach out of you have any comments or questions. I don't expect I have time to implement these changes but thought leaving this here would give some ideas to someone who might.