diff options
author | Gen <z.rz2323721@gmail.com> | 2015-07-27 08:36:21 +0800 |
---|---|---|
committer | Gen <z.rz2323721@gmail.com> | 2015-07-27 08:36:21 +0800 |
commit | 88bf7f35e18f968c14223e4a48f810b003955b88 (patch) | |
tree | 802d3e9848640644eee3657bbbfe153c17f24801 /scene/2d | |
parent | 07c99e11f5939699fefa10fab0b898ddc9246f85 (diff) |
Fixed the mouse position for control when it is in a canvas_layer.
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/canvas_item.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 789c6bdbe4..19b1057abe 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -1146,6 +1146,8 @@ Matrix32 CanvasItem::get_canvas_transform() const { if (canvas_layer) return canvas_layer->get_transform(); + else if (get_parent()->cast_to<CanvasItem>()) + return get_parent()->cast_to<CanvasItem>()->get_canvas_transform(); else return get_viewport()->get_canvas_transform(); |