mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
Fix crash caused by wrong pointer used after VtxBuffer resized during 3d navigator rendering (#5719)
This commit is contained in:
parent
9ae9585e94
commit
54653ea316
1 changed files with 2 additions and 2 deletions
|
@ -2941,7 +2941,7 @@ namespace IMGUIZMO_NAMESPACE
|
||||||
if (iPass) {
|
if (iPass) {
|
||||||
// Draw face label
|
// Draw face label
|
||||||
ImDrawList* drawList = gContext.mDrawList;
|
ImDrawList* drawList = gContext.mDrawList;
|
||||||
ImDrawVert* vtx_write_start = drawList->_VtxWritePtr;
|
int vtx_write_start = drawList->VtxBuffer.Size;
|
||||||
|
|
||||||
const auto label = gContext.mStyle.FaceLabels[iFace];
|
const auto label = gContext.mStyle.FaceLabels[iFace];
|
||||||
ImVec2 labelSize = ImGui::CalcTextSize(label);
|
ImVec2 labelSize = ImGui::CalcTextSize(label);
|
||||||
|
@ -2978,7 +2978,7 @@ namespace IMGUIZMO_NAMESPACE
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto v = vtx_write_start; v < vtx_write_end; v++) {
|
for (auto v = (drawList->VtxBuffer.Data + vtx_write_start); v < vtx_write_end; v++) {
|
||||||
auto pp = ((v->pos - labelOrigin) * scaleFactor * invert2 + ImVec2{0.5, 0.5}) * 2.f;
|
auto pp = ((v->pos - labelOrigin) * scaleFactor * invert2 + ImVec2{0.5, 0.5}) * 2.f;
|
||||||
vec_t pt = tdx * pp.x + tdy * pp.y;
|
vec_t pt = tdx * pp.x + tdy * pp.y;
|
||||||
v->pos = worldToPos((pt + origin) * 0.5 * invert, res, position, size);
|
v->pos = worldToPos((pt + origin) * 0.5 * invert, res, position, size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue