| 1136 | } |
| 1137 | |
| 1138 | inline void SetAxisLabel(ImPlotAxis& axis, const char* label) { |
| 1139 | if (label && ImGui::FindRenderedTextEnd(label, nullptr) != label) { |
| 1140 | axis.LabelOffset = TextBuffer.size(); |
| 1141 | TextBuffer.append(label, label + strlen(label) + 1); |
| 1142 | } |
| 1143 | else { |
| 1144 | axis.LabelOffset = -1; |
| 1145 | } |
| 1146 | } |
| 1147 | |
| 1148 | inline const char* GetAxisLabel(const ImPlotAxis& axis) const { return TextBuffer.Buf.Data + axis.LabelOffset; } |
| 1149 | }; |