How to detect the boundary?

Write a program that enables the user to add and remove points in a two-dimensional plane dynamically, as shown in Figure 15.31a. A minimum bounding rectangle is updated as the points are
added and removed. Assume the radius of each point is 10 pixels.

in a canvas, left-click to add a circle, expand the range of the canvas (rectangle) if the circle is not in the canvas; right-click to delete the circle, and narrow the canvas range if you delete the one on the boundary.
the question is, how do you detect boundaries if you want to shrink them? Do you need any complex data structures?

Jun.16,2022

Store the position of the inner circle as an ordered array (incrementing as an example), delete the add all Operand array and reorder

data = [
    {
        top:10,
        left:100
    }
    ...
]

the data is as above. Finding the maximum and minimum values after each operation is the boundary

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45c6d-44b7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45c6d-44b7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?