So there are. My bad, I didn't even think to look.
https://github.com/julianstorer/JUCE/blob/f1ad44e2bfd49acd19800342e944aaec7a3c04dd/examples/Demo/Source/Demos/WindowsDemo.cpp#L282 <-- looks like this line's a deadun btw
Maybe https://www.juce.com/doc/classRectangle under "See also:" could reference RectanglePlacement ...
Also for the detailed description, maybe something like the following would help a newcomer:
Helper class for positioning one rectangle inside another, e.g.
// justify 20x10 rect along bottom of viewport
RectanglePlacement placementObject {
RectanglePlacement::xMid
| RectanglePlacement::yBottom
| RectanglePlacement::doNotResize };
Rectangle<int> viewport{100,100}, r{20,10}, output = placementObject.appliedTo(r, viewport);
DBG(output.toString()); //40 90 20 10
That instantly gets to the heart of it. The current description makes perfect sense if you already understand what the class is doing, but for a newcomer it's maybe a little tricky to grok.
I mean the thing is trivial once you see it. But if you've never seen that construct, and are just browsing API...
I frequently think about the idea of documenting an entire technology primarily with minimal examples. A bit like https://docs.python.org/3/tutorial/introduction.html but pushed even further i.e. Accompanying text starts to become the exception rather than the default.
I tutor maths for my day job, and I find the same kind of thing works really well. In fact I'm using JUCE to teach one boy C++, and he gets everything straightaway if I just give examples. But it's ten times more work to use English.
Using JUCE as a vehicle for teaching C++ is rather an interesting idea I think. Because graphics, audio, etc are at hand, so it brings it to life. Otherwise it's a bit dry working with console output. And the fact JUCE works on the three major desktop platforms means that you could teach a class and not worry about individual students constantly running into platform specific issues because they have different laptop OS.
mmm late night ramble. But if you can't ramble on a forum, where?? :)
π