summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/tile_map.cpp25
-rw-r--r--scene/2d/tile_map.h4
-rw-r--r--scene/gui/base_button.cpp2
-rw-r--r--scene/main/canvas_item.cpp2
-rw-r--r--scene/main/canvas_item.h4
-rw-r--r--scene/main/viewport.cpp2
6 files changed, 35 insertions, 4 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index c7a809f6d8..c2951559a4 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -412,6 +412,9 @@ void TileMap::update_dirty_quadrants() {
vs->canvas_item_set_light_mask(canvas_item, get_light_mask());
vs->canvas_item_set_z_index(canvas_item, z_index);
+ vs->canvas_item_set_default_texture_filter(canvas_item, RS::CanvasItemTextureFilter(CanvasItem::get_texture_filter()));
+ vs->canvas_item_set_default_texture_repeat(canvas_item, RS::CanvasItemTextureRepeat(CanvasItem::get_texture_repeat()));
+
q.canvas_items.push_back(canvas_item);
if (debug_shapes) {
@@ -1687,6 +1690,28 @@ bool TileMap::get_clip_uv() const {
return clip_uv;
}
+void TileMap::set_texture_filter(TextureFilter p_texture_filter) {
+ CanvasItem::set_texture_filter(p_texture_filter);
+ for (Map<PosKey, Quadrant>::Element *F = quadrant_map.front(); F; F = F->next()) {
+ Quadrant &q = F->get();
+ for (List<RID>::Element *E = q.canvas_items.front(); E; E = E->next()) {
+ RenderingServer::get_singleton()->canvas_item_set_default_texture_filter(E->get(), RS::CanvasItemTextureFilter(p_texture_filter));
+ _make_quadrant_dirty(F);
+ }
+ }
+}
+
+void TileMap::set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) {
+ CanvasItem::set_texture_repeat(p_texture_repeat);
+ for (Map<PosKey, Quadrant>::Element *F = quadrant_map.front(); F; F = F->next()) {
+ Quadrant &q = F->get();
+ for (List<RID>::Element *E = q.canvas_items.front(); E; E = E->next()) {
+ RenderingServer::get_singleton()->canvas_item_set_default_texture_repeat(E->get(), RS::CanvasItemTextureRepeat(p_texture_repeat));
+ _make_quadrant_dirty(F);
+ }
+ }
+}
+
String TileMap::get_configuration_warning() const {
String warning = Node2D::get_configuration_warning();
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index 7a2a3e412c..b9dd8f5405 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -342,6 +342,10 @@ public:
String get_configuration_warning() const override;
+ virtual void set_texture_filter(CanvasItem::TextureFilter p_texture_filter) override;
+
+ virtual void set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) override;
+
void fix_invalid_tiles();
void clear();
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 211082d610..2e77d20d4e 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -345,7 +345,7 @@ String BaseButton::get_tooltip(const Point2 &p_pos) const {
String tooltip = Control::get_tooltip(p_pos);
if (shortcut_in_tooltip && shortcut.is_valid() && shortcut->is_valid()) {
String text = shortcut->get_name() + " (" + shortcut->get_as_text() + ")";
- if (shortcut->get_name().nocasecmp_to(tooltip) != 0) {
+ if (tooltip != String() && shortcut->get_name().nocasecmp_to(tooltip) != 0) {
text += "\n" + tooltip;
}
tooltip = text;
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp
index 5cd45ea408..796408a38d 100644
--- a/scene/main/canvas_item.cpp
+++ b/scene/main/canvas_item.cpp
@@ -1369,6 +1369,7 @@ void CanvasItem::set_texture_filter(TextureFilter p_texture_filter) {
}
texture_filter = p_texture_filter;
_update_texture_filter_changed(true);
+ _change_notify();
}
CanvasItem::TextureFilter CanvasItem::get_texture_filter() const {
@@ -1421,6 +1422,7 @@ void CanvasItem::set_texture_repeat(TextureRepeat p_texture_repeat) {
}
texture_repeat = p_texture_repeat;
_update_texture_repeat_changed(true);
+ _change_notify();
}
CanvasItem::TextureRepeat CanvasItem::get_texture_repeat() const {
diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h
index d9ffe770ff..3f32df87a7 100644
--- a/scene/main/canvas_item.h
+++ b/scene/main/canvas_item.h
@@ -405,10 +405,10 @@ public:
void force_update_transform();
- void set_texture_filter(TextureFilter p_texture_filter);
+ virtual void set_texture_filter(TextureFilter p_texture_filter);
TextureFilter get_texture_filter() const;
- void set_texture_repeat(TextureRepeat p_texture_repeat);
+ virtual void set_texture_repeat(TextureRepeat p_texture_repeat);
TextureRepeat get_texture_repeat() const;
// Used by control nodes to retrieve the parent's anchorable area
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index d962171555..b29b40ea5f 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1509,7 +1509,7 @@ void Viewport::_gui_show_tooltip() {
}
Control *which = nullptr;
- String tooltip = _gui_get_tooltip(gui.tooltip, gui.tooltip->get_global_transform().xform_inv(gui.tooltip_pos), &which);
+ String tooltip = _gui_get_tooltip(gui.tooltip, gui.tooltip->get_global_transform().xform_inv(gui.last_mouse_pos), &which);
tooltip = tooltip.strip_edges();
if (tooltip.length() == 0) {
return; // bye