summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-04-18 11:43:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-04-18 11:43:54 -0300
commit0360b454a432dc851cc1c5b0c365049ebafcec46 (patch)
treec868fbef7de718007e671448865a75381b8c8302 /scene/gui
parentb8593c6f3fd4726584e56e684c9ebb5a8147ff0c (diff)
-Fixed viewport stretch bugs
-Fixed input in viewport stretch bugs -Fixed tilemap pixel overlap (really?)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/control.cpp22
-rw-r--r--scene/gui/control.h1
2 files changed, 4 insertions, 19 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index e0604b7cb8..4b4b4b3c73 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -645,19 +645,6 @@ void Control::_notification(int p_notification) {
}
-Size2 Control::_window_get_pos() const {
-
- if (data.viewport) {
-
- Rect2 r = data.viewport->get_visible_rect();
- return r.pos;
- } else
- return Point2();
-
- //return get_global_transform().get_origin();
-}
-
-
bool Control::clips_input() const {
return false;
@@ -956,12 +943,11 @@ void Control::_window_input_event(InputEvent p_event) {
window->key_event_accepted=false;
Point2 mpos =(get_canvas_transform()).affine_inverse().xform(Point2(p_event.mouse_button.x,p_event.mouse_button.y));
-
if (p_event.mouse_button.pressed) {
- Size2 pos = mpos - _window_get_pos();
+ Size2 pos = mpos;
if (window->mouse_focus && p_event.mouse_button.button_index!=window->mouse_focus_button) {
//do not steal mouse focus and stuff
@@ -1062,7 +1048,7 @@ void Control::_window_input_event(InputEvent p_event) {
if (window->mouse_over && window->drag_data.get_type()!=Variant::NIL && p_event.mouse_button.button_index==BUTTON_LEFT) {
- Size2 pos = mpos - _window_get_pos();
+ Size2 pos = mpos;
pos = window->focus_inv_xform.xform(pos);
window->mouse_over->drop_data(pos,window->drag_data);
window->drag_data=Variant();
@@ -1072,7 +1058,7 @@ void Control::_window_input_event(InputEvent p_event) {
break;
}
- Size2 pos = mpos - _window_get_pos();
+ Size2 pos = mpos;
p_event.mouse_button.global_x = pos.x;
p_event.mouse_button.global_y = pos.y;
pos = window->focus_inv_xform.xform(pos);
@@ -1103,7 +1089,7 @@ void Control::_window_input_event(InputEvent p_event) {
window->key_event_accepted=false;
Matrix32 localizer = (get_canvas_transform()).affine_inverse();
- Size2 pos = localizer.xform(Size2(p_event.mouse_motion.x,p_event.mouse_motion.y)) - _window_get_pos();
+ Size2 pos = localizer.xform(Size2(p_event.mouse_motion.x,p_event.mouse_motion.y));
Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x,p_event.mouse_motion.speed_y));
Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x,p_event.mouse_motion.relative_y));
diff --git a/scene/gui/control.h b/scene/gui/control.h
index dd8854f80e..f9225a1c2b 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -193,7 +193,6 @@ private:
float _get_parent_range(int p_idx) const;
float _get_range(int p_idx) const;
- Point2 _window_get_pos() const;
float _s2a(float p_val, AnchorType p_anchor,float p_range) const;
float _a2s(float p_val, AnchorType p_anchor,float p_range) const;
void _modal_stack_remove();