summaryrefslogtreecommitdiff
path: root/editor/plugins/tiles
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-23 20:43:43 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-23 22:26:07 +0545
commitcc51b045da4bf40722d347c6306b2764a1c9d813 (patch)
tree96323b3b6cd43dbbec3a74a9c09762c911e9dc32 /editor/plugins/tiles
parent2ec1152b0fda21f2050b30e49630659697a5e68b (diff)
Construct values only when necessary.
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp2
-rw-r--r--editor/plugins/tiles/tiles_editor_plugin.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index d6a5dfae06..8b5b576369 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -790,7 +790,7 @@ void TileMapEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p_over
// Get the tile modulation.
Color modulate = tile_data->get_modulate();
Color self_modulate = tile_map->get_self_modulate();
- modulate = Color(modulate.r * self_modulate.r, modulate.g * self_modulate.g, modulate.b * self_modulate.b, modulate.a * self_modulate.a);
+ modulate *= self_modulate;
// Draw the tile.
p_overlay->draw_texture_rect_region(atlas_source->get_texture(), dest_rect, source_rect, modulate * Color(1.0, 1.0, 1.0, 0.5), transpose, tile_set->is_uv_clipping());
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp
index 79b869b511..f51f4625a9 100644
--- a/editor/plugins/tiles/tiles_editor_plugin.cpp
+++ b/editor/plugins/tiles/tiles_editor_plugin.cpp
@@ -146,7 +146,7 @@ void TilesEditor::synchronize_atlas_view(Object *p_current) {
ERR_FAIL_COND(!tile_atlas_view);
if (tile_atlas_view->is_visible_in_tree()) {
- tile_atlas_view->set_transform(atlas_view_zoom, Vector2(atlas_view_scroll.x, atlas_view_scroll.y));
+ tile_atlas_view->set_transform(atlas_view_zoom, atlas_view_scroll);
}
}