Merge pull request #37122 from rmvermeulen/proposal-590/viewport-size-warning

Add size warning to Viewport Node
This commit is contained in:
Rémi Verschelde 2020-03-18 08:15:12 +01:00 committed by GitHub
commit 6b6174e210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -2948,12 +2948,14 @@ Control *Viewport::get_modal_stack_top() const {
}
String Viewport::get_configuration_warning() const {
/*if (get_parent() && !Object::cast_to<Control>(get_parent()) && !render_target) {
return TTR("This viewport is not set as render target. If you intend for it to display its contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign its internal texture to some node for display.");
}*/
if (size.x == 0 || size.y == 0) {
return TTR("Viewport size must be greater than 0 to render anything.");
}
return String();
}