summaryrefslogtreecommitdiffstats
path: root/scene/2d/sprite_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/sprite_2d.cpp')
-rw-r--r--scene/2d/sprite_2d.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp
index 3c19dd0020..efb5029ac4 100644
--- a/scene/2d/sprite_2d.cpp
+++ b/scene/2d/sprite_2d.cpp
@@ -31,7 +31,6 @@
#include "sprite_2d.h"
#include "scene/main/window.h"
-#include "scene/scene_string_names.h"
#ifdef TOOLS_ENABLED
Dictionary Sprite2D::_edit_get_state() const {
@@ -146,7 +145,7 @@ void Sprite2D::set_texture(const Ref<Texture2D> &p_texture) {
}
queue_redraw();
- emit_signal(SceneStringNames::get_singleton()->texture_changed);
+ emit_signal(SceneStringName(texture_changed));
item_rect_changed();
}
@@ -260,7 +259,7 @@ void Sprite2D::set_frame(int p_frame) {
frame = p_frame;
item_rect_changed();
- emit_signal(SceneStringNames::get_singleton()->frame_changed);
+ emit_signal(SceneStringName(frame_changed));
}
int Sprite2D::get_frame() const {
@@ -374,8 +373,7 @@ bool Sprite2D::is_pixel_opaque(const Point2 &p_point) const {
q.y = texture->get_size().height - q.y - 1;
}
} else {
- q.x = MIN(q.x, texture->get_size().width - 1);
- q.y = MIN(q.y, texture->get_size().height - 1);
+ q = q.min(texture->get_size() - Vector2(1, 1));
}
return texture->is_pixel_opaque((int)q.x, (int)q.y);