Open Ovilia opened 2 years ago
Thank for the contribution.
I don't think the fix is correct. Math.floor(Math.max(ngx, ngy) / 2)
is the distance to the nearest edge from the center, right? First of all, center
can be moved, so you would need consider that. Second of all, what if the shape
is a square
and we do want to fill all four corners of the canvas? The proposed maxRadius
in that case will not be enough.
Feel free to propose better logic (preferably without yet another options — there are too many of these and they are conflicting sometimes, as evidenced by this case — sorry for the bad catch-all API design!
This PR fixes
maxRadius
so that text does not overflows the shape.Before
Take
shape: 'circle'
and'diamond'
for example, when text list contains too many text, it will overflows the shape.After
Test case used: