@@ -161,7 +161,7 @@ class YUP_API RectangleList
161161 */
162162 [[nodiscard]] bool contains (ValueType x, ValueType y, ValueType width, ValueType height) const
163163 {
164- return rectangles. contains (x, y, width, height);
164+ return contains (RectangleType{ x, y, width, height } );
165165 }
166166
167167 [[nodiscard]] bool contains (const RectangleType& rect) const
@@ -177,21 +177,21 @@ class YUP_API RectangleList
177177 @return true if the point is contained within any rectangle in the list, false otherwise.
178178 */
179179 [[nodiscard]] bool contains (ValueType x, ValueType y) const
180+ {
181+ return contains (Point<ValueType>{ x, y });
182+ }
183+
184+ [[nodiscard]] bool contains (const Point<ValueType>& point) const
180185 {
181186 for (const auto & rect : rectangles)
182187 {
183- if (rect.contains (x, y ))
188+ if (rect.contains (point ))
184189 return true ;
185190 }
186191
187192 return false ;
188193 }
189194
190- [[nodiscard]] bool contains (const Point<ValueType>& point) const
191- {
192- return contains (point.getX (), point.getY ());
193- }
194-
195195 // ==============================================================================
196196 /* * Checks if the list intersects a specified rectangle.
197197
@@ -200,21 +200,21 @@ class YUP_API RectangleList
200200 @return True if the rectangle intersects the list, otherwise false.
201201 */
202202 [[nodiscard]] bool intersects (ValueType x, ValueType y, ValueType width, ValueType height) const
203+ {
204+ return intersects (RectangleType{ x, y, width, height });
205+ }
206+
207+ [[nodiscard]] bool intersects (const RectangleType& rect) const
203208 {
204209 for (const auto & rect : rectangles)
205210 {
206- if (rect.intersects (x, y, width, height ))
211+ if (rect.intersects (rect ))
207212 return true ;
208213 }
209214
210215 return false ;
211216 }
212217
213- [[nodiscard]] bool intersects (const RectangleType& rect) const
214- {
215- return intersects (rect.getX (), rect.getY (), rect.getWidth (), rect.getHeight ());
216- }
217-
218218 // ==============================================================================
219219 /* * Returns the number of rectangles in the list.
220220
0 commit comments