@@ -172,4 +172,32 @@ public function testGetVectorsAngle(): void
172172 $ res = $ draw ->getVectorsAngle (1 , 0 , -1 , 0 );
173173 $ this ->bcAssertEqualsWithDelta (M_PI , $ res );
174174 }
175+
176+ public function testGetRawEllipticalArcBboxPopulated (): void
177+ {
178+ $ draw = $ this ->getTestObject ();
179+ $ bbox = [];
180+ // full circle: bbox should be fully populated (no sentinel values remaining)
181+ $ draw ->getRawEllipticalArc (3 , 5 , 7 , 11 , 0 , 0 , 360 , false , 2 , true , true , false , $ bbox );
182+ $ this ->assertCount (4 , $ bbox );
183+ $ this ->assertLessThan (PHP_INT_MAX , $ bbox [0 ]); // min-x was updated
184+ $ this ->assertLessThan (PHP_INT_MAX , $ bbox [1 ]); // min-y was updated
185+ $ this ->assertGreaterThan (PHP_INT_MIN , $ bbox [2 ]); // max-x was updated
186+ $ this ->assertGreaterThan (PHP_INT_MIN , $ bbox [3 ]); // max-y was updated
187+ }
188+
189+ public function testGetRawEllipticalArcBboxNegativeMaxValues (): void
190+ {
191+ $ draw = $ this ->getTestObject ();
192+ // Arc from 45° to 90° with centre at (0, 0) and vertical radius 5.
193+ // In this range every cy control point is negative (cy = -rdv * sin(ang)).
194+ // The PHP_INT_MIN initialisation ensures the max values are updated correctly
195+ // even when all sampled points are negative.
196+ $ bbox = [];
197+ $ draw ->getRawEllipticalArc (0 , 0 , 7 , 5 , 0 , 45 , 90 , false , 2 , true , true , false , $ bbox );
198+ $ this ->assertCount (4 , $ bbox );
199+ $ this ->assertGreaterThan (PHP_INT_MIN , $ bbox [2 ]); // max-x was updated from sentinel
200+ $ this ->assertGreaterThan (PHP_INT_MIN , $ bbox [3 ]); // max-y was updated from sentinel
201+ $ this ->assertLessThan (0 , $ bbox [3 ]); // all cy values in this arc are < 0
202+ }
175203}
0 commit comments