Package: graphene
Function graphene:rect-round-extents
Lambda Listgraphene:rect-round-extents (r result) ArgumentsReturn ValueThe graphene:rect-t instance with the rectangle with rounded extents. Details
Rounds the origin of the given rectangle to its nearest integers recompute
the size so that the rectangle is large enough to contain all the corners
of the original rectangle. This function is the equivalent of calling floor on the coordinates of the origin, and recomputing the size calling ceil on the bottom-right coordinates. If you want to be sure that the rounded rectangle completely covers the area that was covered by the original rectangle - i.e. you want to cover the area including all its corners - this function will make sure that the size is recomputed taking into account the ceiling of the coordinates of the bottom-right corner. If the difference between the original coordinates and the coordinates of the rounded rectangle is greater than the difference between the original size and and the rounded size, then the move of the origin would not be compensated by a move in the anti-origin, leaving the corners of the original rectangle outside the rounded one. | See also |
#2023-12-9