Fixes drawing of the 2D plugins on the 3D view

This commit is contained in:
groud 2018-09-18 20:00:07 +02:00
parent f148e8eede
commit 5172642c32
18 changed files with 100 additions and 70 deletions

View file

@ -319,13 +319,11 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return false;
}
void LightOccluder2DEditor::forward_draw_over_viewport(Control *p_overlay) {
void LightOccluder2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
if (!node || !node->get_occluder_polygon().is_valid())
return;
Control *vpc = canvas_item_editor->get_viewport_control();
Vector<Vector2> poly;
if (wip_active)
@ -353,9 +351,9 @@ void LightOccluder2DEditor::forward_draw_over_viewport(Control *p_overlay) {
if (i == poly.size() - 1 && (!node->get_occluder_polygon()->is_closed() || wip_active)) {
} else {
vpc->draw_line(point, next_point, col, 2);
p_overlay->draw_line(point, next_point, col, 2);
}
vpc->draw_texture(handle, point - handle->get_size() * 0.5);
p_overlay->draw_texture(handle, point - handle->get_size() * 0.5);
}
}