Closed davestewart closed 5 years ago
Region
is the core primitive data structure of most classical window systems; if you've ever used Region
in X Windows, or HRGN
in MS Windows, you already know what it is, how it works, and why you'd want it. And my JS implementation is designed similarly to how the Region data structure worked in some older implementations of X Windows: Banded rectangles.
This library is bigger than some libraries for managing screen rectangles, but unlike the others I've seen, this is the real deal: It's the full, general-purpose solution, supporting arbitrary constructive-solid-geometry operations on arbitrarily-complex sets of planar space in linear time. If you haven't played with the live demo, you should give it a try.
I swear not everything I do involves rectangles, but they are a rather nice primitive for a lot of needs :)
Glad you liked SM back in the day! SM 3.x still exists out there on Windows: It's being sold (and maintained) now by StarDock.
Sean,
It took quite a few attempts to find this library; NPM kept turning up false positives, but I wanted something I could use to work out screen-space for multiple browser windows, and I think this is it!
Very much looking forward to using it.
But what really tickled my fancy is when I saw who wrote it - SpaceMonger used to be my all-time favourite utility on Windows! I'm Mac these days, but it would be fair to say I loved SpaceMonger. What a simply brilliant bit of software, especially in the days that hard disk space was limited.
Anyway, Region2D is more of the same - rectangles!
Many, many thanks for writing and sharing such great code.
Cheers, Dave