mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
AddCircle, AddCircleFilled: Add auto-calculation of circle segment counts
This commit is contained in:
@ -855,6 +855,7 @@ struct IMGUI_API ImDrawListSharedData
|
||||
ImFont* Font; // Current/default font (optional, for simplified AddText overload)
|
||||
float FontSize; // Current/default font size (optional, for simplified AddText overload)
|
||||
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
|
||||
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
|
||||
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
||||
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
||||
|
||||
@ -862,6 +863,13 @@ struct IMGUI_API ImDrawListSharedData
|
||||
// FIXME: Bake rounded corners fill/borders in atlas
|
||||
ImVec2 CircleVtx12[12];
|
||||
|
||||
// Cached circle segment counts for the first <n> radii (to avoid calculation overhead)
|
||||
static const int NumCircleSegmentCounts = 64;// Number of circle segment counts to cache (i.e. the maximum radius before we calculate dynamically)
|
||||
int CircleSegmentCounts[NumCircleSegmentCounts]; // The segment count for radius (array index + 1)
|
||||
float CircleSegmentCountsMaxCircleSegmentError; // The MaxCircleSegmentError used to calculate these counts
|
||||
|
||||
void RecalculateCircleSegmentCounts(); // Recalculate circle segment counts based on the current MaxCircleSegmentError
|
||||
|
||||
ImDrawListSharedData();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user