Closed 17cupsofcoffee closed 3 years ago
My first thought upon reading "union of two rectangles" was a rectangle that is the overlap of two rectangles x) I dont know if others would have that first thought (im probably totally wrong but i bring it up because it might be useful to know when writing docs)
Yeah, I'm not sure about the naming either - I need to have a look at what other libraries call it :)
also union
is a keyword lmao
r#union sounds like a great variable name
Added Rectangle::combine
on the main
branch :)
Summary:
There should be a method on
Rectangle
that gives you the union of two rectangles (i.e. a rectangle that surrounds them both).The text caching functionality already does this to calculate the text's bounds, it just needs pulling out into a seperate method.
Why is this needed?
It's handy, and people have asked for it.