mirror of
https://github.com/gwm17/implot.git
synced 2024-11-26 20:28:50 -05:00
fix clip rect mismatch
This commit is contained in:
parent
2c95c700c3
commit
218ed09289
|
@ -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)
|
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);
|
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) {
|
if (x_label) {
|
||||||
const ImVec2 xLabel_size = CalcTextSize(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) {
|
if (y_label) {
|
||||||
const ImVec2 yLabel_size = CalcTextSizeVertical(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);
|
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 -----------------------------------------------------------
|
// FINAL RENDER -----------------------------------------------------------
|
||||||
|
|
||||||
PushClipRect(gp.BB_Grid.Min, gp.BB_Frame.Max, true);
|
|
||||||
|
|
||||||
// render ticks
|
// render ticks
|
||||||
PushPlotClipRect();
|
PushPlotClipRect();
|
||||||
if (HasFlag(plot.XAxis.Flags, ImAxisFlags_TickMarks)) {
|
if (HasFlag(plot.XAxis.Flags, ImAxisFlags_TickMarks)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user