mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Demo: Custom Rendering: Fixed clipping rectangle extruding out of parent window.
This commit is contained in:
parent
852ece3a0e
commit
0858c3d7cb
@ -2327,7 +2327,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
|||||||
points.pop_back();
|
points.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x+canvas_size.x, canvas_pos.y+canvas_size.y)); // clip lines within the canvas (if we resize it, etc.)
|
draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x+canvas_size.x, canvas_pos.y+canvas_size.y), true); // clip lines within the canvas (if we resize it, etc.)
|
||||||
for (int i = 0; i < points.Size - 1; i += 2)
|
for (int i = 0; i < points.Size - 1; i += 2)
|
||||||
draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i+1].x, canvas_pos.y + points[i+1].y), IM_COL32(255,255,0,255), 2.0f);
|
draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i+1].x, canvas_pos.y + points[i+1].y), IM_COL32(255,255,0,255), 2.0f);
|
||||||
draw_list->PopClipRect();
|
draw_list->PopClipRect();
|
||||||
|
Loading…
Reference in New Issue
Block a user