summaryrefslogtreecommitdiffstats
path: root/editor/plugins/texture_region_editor_plugin.cpp
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-07-01 12:59:42 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-07-01 12:59:42 +0200
commit3c154eb93b3a098354bf6d18a9428826ec193f90 (patch)
treed9c8c44f13883ceadaefc95953f9cb077137b7c8 /editor/plugins/texture_region_editor_plugin.cpp
parenteaaff9da3178fa515a0f051fda932c1dd04d53db (diff)
downloadredot-engine-3c154eb93b3a098354bf6d18a9428826ec193f90.tar.gz
Remove unnecessary code and add some error explanations
Diffstat (limited to 'editor/plugins/texture_region_editor_plugin.cpp')
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 4e15bd5116..8f58fbd6ab 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -192,8 +192,8 @@ void TextureRegionEditor::_region_draw() {
}
updating_scroll = false;
- float margins[4];
if (node_ninepatch || obj_styleBox.is_valid()) {
+ float margins[4];
if (node_ninepatch) {
margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP);
margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM);
@@ -204,6 +204,11 @@ void TextureRegionEditor::_region_draw() {
margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM);
margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT);
margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT);
+ } else {
+ margins[0] = 0;
+ margins[1] = 0;
+ margins[2] = 0;
+ margins[3] = 0;
}
Vector2 pos[4] = {
mtx.basis_xform(Vector2(0, margins[0])) + Vector2(0, endpoints[0].y - draw_ofs.y * draw_zoom),