1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 20:28:50 -05:00

ImPlotAxis::WillRender(): return false if axis is disabled (#350)

This saves a few CPU cycles in SetupFinish(), which otherwise formats
tick labels & spacing for disabled axes.
This commit is contained in:
Max Schwarz 2022-04-21 05:19:39 +02:00 committed by GitHub
parent df4256c9e8
commit 196a0243c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -796,7 +796,7 @@ struct ImPlotAxis
inline bool HasGridLines() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoGridLines); } inline bool HasGridLines() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoGridLines); }
inline bool HasTickLabels() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickLabels); } inline bool HasTickLabels() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickLabels); }
inline bool HasTickMarks() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickMarks); } inline bool HasTickMarks() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickMarks); }
inline bool WillRender() const { return HasGridLines() || HasTickLabels() || HasTickMarks(); } inline bool WillRender() const { return Enabled && (HasGridLines() || HasTickLabels() || HasTickMarks()); }
inline bool IsOpposite() const { return ImHasFlag(Flags, ImPlotAxisFlags_Opposite); } inline bool IsOpposite() const { return ImHasFlag(Flags, ImPlotAxisFlags_Opposite); }
inline bool IsInverted() const { return ImHasFlag(Flags, ImPlotAxisFlags_Invert); } inline bool IsInverted() const { return ImHasFlag(Flags, ImPlotAxisFlags_Invert); }
inline bool IsForeground() const { return ImHasFlag(Flags, ImPlotAxisFlags_Foreground); } inline bool IsForeground() const { return ImHasFlag(Flags, ImPlotAxisFlags_Foreground); }