summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/baked_light_instance.cpp2
-rw-r--r--scene/3d/collision_polygon.cpp2
-rw-r--r--scene/gui/control.cpp15
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/line_edit.cpp4
-rw-r--r--scene/gui/line_edit.h2
-rw-r--r--scene/gui/text_edit.cpp3
-rw-r--r--scene/gui/text_edit.h1
8 files changed, 29 insertions, 2 deletions
diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp
index b55093a779..1ae7866f0b 100644
--- a/scene/3d/baked_light_instance.cpp
+++ b/scene/3d/baked_light_instance.cpp
@@ -81,7 +81,7 @@ float BakedLightSampler::get_param(Param p_param) const{
void BakedLightSampler::set_resolution(int p_resolution){
- ERR_FAIL_COND(p_resolution<4 && p_resolution>32);
+ ERR_FAIL_COND(p_resolution<4 || p_resolution>32);
resolution=p_resolution;
VS::get_singleton()->baked_light_sampler_set_resolution(base,resolution);
}
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index c857b4851a..bb0a1fca12 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -126,7 +126,7 @@ void CollisionPolygon::_notification(int p_what) {
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!can_update_body && shape_from>=0 && shape_from>=0) {
+ if (!can_update_body && shape_from>=0 && shape_to>=0) {
CollisionObject *co = get_parent()->cast_to<CollisionObject>();
if (co) {
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index a1c0644650..bd6b8078ff 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2713,6 +2713,21 @@ void Control::warp_mouse(const Point2& p_to_pos) {
get_viewport()->warp_mouse(get_global_transform().xform(p_to_pos));
}
+
+bool Control::is_text_field() const {
+/*
+ if (get_script_instance()) {
+ Variant v=p_point;
+ const Variant *p[2]={&v,&p_data};
+ Variant::CallError ce;
+ Variant ret = get_script_instance()->call("is_text_field",p,2,ce);
+ if (ce.error==Variant::CallError::CALL_OK)
+ return ret;
+ }
+ */
+ return false;
+}
+
void Control::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_window_input_event"),&Control::_window_input_event);
diff --git a/scene/gui/control.h b/scene/gui/control.h
index a759fafbc9..4311b299c8 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -382,6 +382,8 @@ public:
void warp_mouse(const Point2& p_to_pos);
+ virtual bool is_text_field() const;
+
Control();
~Control();
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index fec9e401f1..2b4d7db01e 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -782,6 +782,10 @@ void LineEdit::select(int p_from, int p_to) {
update();
}
+bool LineEdit::is_text_field() const {
+
+ return true;
+}
void LineEdit::_bind_methods() {
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index c19043e826..b1c4c8f616 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -112,6 +112,8 @@ public:
void select(int p_from=0, int p_to=-1);
virtual Size2 get_minimum_size() const;
+
+ virtual bool is_text_field() const;
LineEdit();
~LineEdit();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 048901a879..be6c0d0a8b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3568,7 +3568,10 @@ void TextEdit::set_show_line_numbers(bool p_show) {
update();
}
+bool TextEdit::is_text_field() const {
+ return true;
+}
void TextEdit::_bind_methods() {
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 1b448bb782..9ffe8a5bae 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -393,6 +393,7 @@ public:
String get_text_for_completion();
+ virtual bool is_text_field() const;
TextEdit();
~TextEdit();
};