From: Mikko Rasa Date: Sun, 26 Jan 2025 15:02:23 +0000 (+0200) Subject: Make sure ico sphere's subdivisions is at least 1 X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=7f656a4616976f7d9549d3ea75035d95e00fbe75;p=libs%2Fgl.git Make sure ico sphere's subdivisions is at least 1 --- diff --git a/source/builders/sphere.cpp b/source/builders/sphere.cpp index 7873d3a2..d2b2eec2 100644 --- a/source/builders/sphere.cpp +++ b/source/builders/sphere.cpp @@ -127,6 +127,9 @@ IcoSphereBuilder::IcoSphereBuilder(float r, unsigned s): radius(r), subdivision(s) { + if(subdivision<1) + subdivision = 1; + if(base_edges[0]==base_edges[1]) initialize_edges(); }