draw_manager icon indicating copy to clipboard operation
draw_manager copied to clipboard

Circles not drawing correctly

Open threw32 opened this issue 5 years ago • 1 comments

Hi,

im currently having some issues with the drawing of circles. it seems to start appearing in a radius <= 40. first it looks like its drawing more than 360 degrees and the lower the radius is the less will be drawn. i will post some pictures below. im using the filled circle from the example, just without the decreasing degrees (using the default args for filled circle), no other changes to the code have been done. it seems to happen with the non filled circles aswell tho

This is at 41 radius, looks fine to me

This is at 40 radius

And this is at 25 radius

And this is at 5 radius

threw32 avatar Jul 24 '20 12:07 threw32

Hi,

I see what you mean and for now, the reason seems to be an optimization for the number of vertices generated for small circles that incorrectly skips vertices. A quick fix would be to just disable this optimization in draw_manager.cpp:generate_circle_metadata by replacing

skip_count = std::clamp(CIRCLE_POINT_COUNT - static_cast<int>((radius - 1.f) * (CIRCLE_POINT_COUNT / 100.f) * 2.5f), 0, CIRCLE_POINT_COUNT);
if (skip_count > 0)
	point_count /= skip_count;

with skip_count = 0;

I'll try to get around to fixing this properly but right now I don't think I have the time for this, sorry.

T0b1-iOS avatar Jul 25 '20 18:07 T0b1-iOS