summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp9
-rw-r--r--editor/plugins/tile_set_editor_plugin.h1
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/resources/tile_set.cpp3
5 files changed, 14 insertions, 3 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 535ce79b30..b677017371 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -3915,7 +3915,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
if (d.has("snap_enabled")) {
snap_enabled = d["snap_enabled"];
- tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_pressed(d["snap_enabled"]);
+ tool_option_button[TOOL_OPT_USE_SNAP]->set_pressed(d["snap_enabled"]);
}
if (d.has("translate_snap"))
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 08679b781a..612bdb1d2a 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -583,6 +583,14 @@ void AutotileEditor::_notification(int p_what) {
}
}
+void AutotileEditor::_changed_callback(Object *p_changed, const char *p_prop) {
+ if (p_prop == StringName("texture") || p_prop == StringName("is_autotile")) {
+ edit(tile_set.ptr());
+ autotile_list->update();
+ workspace->update();
+ }
+}
+
void AutotileEditor::_on_autotile_selected(int p_index) {
if (get_current_tile() >= 0) {
@@ -1581,6 +1589,7 @@ Vector2 AutotileEditor::snap_point(const Vector2 &point) {
void AutotileEditor::edit(Object *p_node) {
tile_set = Ref<TileSet>(Object::cast_to<TileSet>(p_node));
+ tile_set->add_change_receptor(this);
helper->set_tileset(tile_set);
autotile_list->clear();
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index 9bd3e23181..93d403deea 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -124,6 +124,7 @@ class AutotileEditor : public Control {
protected:
static void _bind_methods();
void _notification(int p_what);
+ virtual void _changed_callback(Object *p_changed, const char *p_prop);
private:
void _on_autotile_selected(int p_index);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f686dc52a0..aa4310da46 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -883,7 +883,7 @@ void TextEdit::_notification(int p_what) {
}
// give visual indication of empty selected line
- if (selection.active && line >= selection.from_line && line <= selection.to_line) {
+ if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) {
int char_w = cache.font->get_char_size(' ').width;
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
}
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 710612d5f4..4d200f5548 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -309,6 +309,7 @@ void TileSet::tile_set_texture(int p_id, const Ref<Texture> &p_texture) {
ERR_FAIL_COND(!tile_map.has(p_id));
tile_map[p_id].texture = p_texture;
emit_changed();
+ _change_notify("texture");
}
Ref<Texture> TileSet::tile_get_texture(int p_id) const {
@@ -386,8 +387,8 @@ void TileSet::tile_set_is_autotile(int p_id, bool p_is_autotile) {
ERR_FAIL_COND(!tile_map.has(p_id));
tile_map[p_id].is_autotile = p_is_autotile;
- _change_notify("");
emit_changed();
+ _change_notify("is_autotile");
}
bool TileSet::tile_get_is_autotile(int p_id) const {