You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-06 17:25:19 +00:00
Don't compile editor-only function when tools=no
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Dictionary Sprite::_edit_get_state() const {
|
||||
Dictionary state = Node2D::_edit_get_state();
|
||||
state["offset"] = offset;
|
||||
@@ -58,6 +59,11 @@ bool Sprite::_edit_use_pivot() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Sprite::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
|
||||
|
||||
return is_pixel_opaque(p_point);
|
||||
}
|
||||
|
||||
Rect2 Sprite::_edit_get_rect() const {
|
||||
return get_rect();
|
||||
}
|
||||
@@ -65,6 +71,7 @@ Rect2 Sprite::_edit_get_rect() const {
|
||||
bool Sprite::_edit_use_rect() const {
|
||||
return texture.is_valid();
|
||||
}
|
||||
#endif
|
||||
|
||||
Rect2 Sprite::get_anchorable_rect() const {
|
||||
return get_rect();
|
||||
@@ -305,11 +312,6 @@ int Sprite::get_hframes() const {
|
||||
return hframes;
|
||||
}
|
||||
|
||||
bool Sprite::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
|
||||
|
||||
return is_pixel_opaque(p_point);
|
||||
}
|
||||
|
||||
bool Sprite::is_pixel_opaque(const Point2 &p_point) const {
|
||||
|
||||
if (texture.is_null())
|
||||
|
||||
Reference in New Issue
Block a user