diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2015-12-10 17:06:27 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2015-12-10 17:06:27 +0100 |
commit | 3b68f0d051ac33a95e78025622c5f93219591da9 (patch) | |
tree | 59fa37d9bb2894332b091d55ab1ccc856908c256 /scene/2d | |
parent | 5f3c87691ecf9159dae4abe741441ef170a33f44 (diff) | |
parent | 88bf7f35e18f968c14223e4a48f810b003955b88 (diff) |
Merge pull request #2306 from dbsGen/patch-1
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 abd532c156..295a57d033 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -1156,6 +1156,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(); |