diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-10 00:06:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-10 00:06:06 +0100 |
commit | 94f00eb6c5323dff933a4985b60e8ebf9391f940 (patch) | |
tree | 88ded271c7dbb70fc5d389b81f177ef9d0f450a1 | |
parent | f2cd52ddd7f57bb2f8065eecd27fde86ba550648 (diff) | |
parent | 133014c3fb224c195a703b517bf318fc0b0e6f59 (diff) |
Merge pull request #33498 from nekomatata/error-save-scene-preview
Fixed errors when saving scene with a shrunk viewport
-rw-r--r-- | editor/editor_node.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d42345d9a2..178871ccfa 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1065,7 +1065,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { img->crop_from_point(x, y, vp_size, vp_size); } else { int ratio = vp_size / preview_size; - int size = preview_size * (ratio / 2); + int size = preview_size * MAX(1, ratio / 2); x = (img->get_width() - size) / 2; y = (img->get_height() - size) / 2; |