Merge pull request #2830 from Ovnuniarchos/ShapeLine2DXPolygonEditor
Corrections to #2808 (2D shapes editor update)
This commit is contained in:
commit
06d842566c
|
@ -42,6 +42,13 @@ Variant CollisionShape2DEditor::get_handle_value(int idx) const {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LINE_SHAPE: {
|
case LINE_SHAPE: {
|
||||||
|
Ref<LineShape2D> line = node->get_shape();
|
||||||
|
|
||||||
|
if (idx==0) {
|
||||||
|
return line->get_d();
|
||||||
|
} else {
|
||||||
|
return line->get_normal();
|
||||||
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -121,7 +128,7 @@ void CollisionShape2DEditor::set_handle(int idx, Point2& p_point) {
|
||||||
if (idx==0){
|
if (idx==0){
|
||||||
line->set_d(p_point.length());
|
line->set_d(p_point.length());
|
||||||
}else{
|
}else{
|
||||||
line->set_normal(p_point/30.0);
|
line->set_normal(p_point.normalized());
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas_item_editor->get_viewport_control()->update();
|
canvas_item_editor->get_viewport_control()->update();
|
||||||
|
|
Loading…
Reference in New Issue