1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00

fix clip rect mismatch

This commit is contained in:
Evan Pezent 2020-05-11 08:41:43 -05:00
parent 2c95c700c3
commit 218ed09289

View File

@ -1234,7 +1234,7 @@ bool BeginPlot(const char* title, const char* x_label, const char* y_label, cons
if (xt.RenderLabel && xt.PixelPos >= gp.BB_Grid.Min.x - 1 && xt.PixelPos <= gp.BB_Grid.Max.x + 1)
DrawList.AddText({xt.PixelPos - xt.Size.x * 0.5f, gp.BB_Grid.Max.y + txt_off}, gp.Col_X.Txt, gp.XTickLabels.Buf.Data + xt.TextOffset);
}
ImGui::PopClipRect();
PopClipRect();
}
if (x_label) {
const ImVec2 xLabel_size = CalcTextSize(x_label);
@ -1258,7 +1258,7 @@ bool BeginPlot(const char* title, const char* x_label, const char* y_label, cons
}
}
}
ImGui::PopClipRect();
PopClipRect();
if (y_label) {
const ImVec2 yLabel_size = CalcTextSizeVertical(y_label);
const ImVec2 yLabel_pos(gp.BB_Canvas.Min.x, gp.BB_Grid.GetCenter().y + yLabel_size.y * 0.5f);
@ -1452,8 +1452,6 @@ void EndPlot() {
// FINAL RENDER -----------------------------------------------------------
PushClipRect(gp.BB_Grid.Min, gp.BB_Frame.Max, true);
// render ticks
PushPlotClipRect();
if (HasFlag(plot.XAxis.Flags, ImAxisFlags_TickMarks)) {