rapideditor / rapid-sdk

🛠️ Map editing made easy
ISC License
33 stars 8 forks source link

Add `Extent.extendSelf(other)` as a mutable version of `Extent.extend(other)` #268

Closed bhousel closed 7 months ago

bhousel commented 7 months ago

Growing an Extent is very common - we do this all the time in the Rapid code.
(Imagine code that loops over 1000 points to determine their bounding box).

In most cases, we modify the Extent's .min and .max directly for performance, rather than using the Extent.extend call. This is because Extent.extend(other) is written in an immutable style, so it returns a new Extent rather than just modifying the existing Extent in-place.

I'm going to change it so there are 2 functions: