From 99eaf317bab4e1cf7242b0081c7fd1a31008fd55 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 17 Jul 2025 23:09:24 +0800 Subject: [PATCH] [Feat] (Range1D): IntersectionUpdate --- MobileGL/MG_Util/Types.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MobileGL/MG_Util/Types.h b/MobileGL/MG_Util/Types.h index 9824d848..69438aa7 100644 --- a/MobileGL/MG_Util/Types.h +++ b/MobileGL/MG_Util/Types.h @@ -91,6 +91,14 @@ namespace MobileGL { start = std::min(start, newStart); end = std::max(end, newEnd); } + + void IntersectionUpdate(SizeT newStart, SizeT newEnd) { + start = std::max(start, newStart); + end = std::min(end, newEnd); + if (start > end) { + throw RuntimeError("Invalid intersection: start must be less than end"); + } + } }; template