Commit Graph

150 Commits

Author SHA1 Message Date
Gilles Roudière 9dfc012369 Remove unecessary _set_global_invalid added by mistake 2024-01-18 10:48:23 +01:00
Yuri Sizov 788aab3a96 Merge pull request #87115 from groud/tilemap_layers_as_nodes
Make TileMapLayers extend Node2D and work as children of TileMap
2024-01-17 18:53:12 +01:00
Yuri Sizov 0724506cdd Merge pull request #86841 from groud/fix_global_transform_in_enter_tree
Fixes global transform being wrong on entering tree
2024-01-17 18:52:59 +01:00
Gilles Roudière 48bed5050b Make TileMapLayers extend Node2D and work as children of TileMap 2024-01-17 16:05:50 +01:00
Gilles Roudière 0a726d692a Fixes global transform being wrong on entering tree 2024-01-16 16:02:37 +01:00
kobewi 0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
Mikael Hermansson a98b94758b Revert "Fix transform notification not getting sent out for RigidBody2D" 2023-11-14 22:17:26 +01:00
Mikael Hermansson 9fb0b52608 Fix transform notification not getting sent out for RigidBody2D 2023-11-13 15:44:32 +01:00
kit d24d73ba31 Make mouse-enter/exit notifications match mouse event propagation
`NOTIFICATION_MOUSE_ENTER` and `NOTIFICATION_MOUSE_EXIT` now includes
the areas of children control nodes if the mouse filters allow it.

In order to check if a Control node itself was entered/exited, the newly
introduced `NOTIFICATION_MOUSE_ENTER_SELF` and
`NOTIFICATION_MOUSE_EXIT_SELF` can be used.

Co-authored-by: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>
2023-11-09 09:11:59 -05:00
Gilles Roudière 73f72409f5 Allow normal maps on TileMaps that use texture padding 2023-10-18 14:55:44 +02:00
bitsawer 12a2177967 Fix notification thread guards 2023-10-02 19:31:54 +03:00
A Thousand Ships a29416e332 [Scene,Main] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-12 12:53:06 +02:00
Markus Sauermann 7f317ef1bf Remove `CanvasItem::_invalidate_global_transform`
The only use of that function can be replaced by `_notify_transform`,
which makes the `propagate_call` unnecessary.
As far as I can tell, the `data.blocked`-checks of `propagate_call`
are not needed in this case, because `_invalidate_global_transform`
causes no user-noticeable changes.
2023-08-30 00:29:42 +02:00
Markus Sauermann 152572ac38 Fix global transform validity for `Node2D` and `Control`
Set global transform to invalid when changing transform
2023-08-08 12:22:55 +02:00
kleonc edba45ec8b Fix click-selecting Sprites with repeated texture 2023-06-22 16:37:08 +02:00
Ninni Pipping dcd2b883eb Use NULL instead of COND checks when appropriate
Restricted to scene
2023-06-10 08:56:30 +02:00
Pedro J. Estébanez 50cf3d6966 Optimize threading-sensitive node data for single-threaded processing 2023-05-17 02:04:41 +02:00
Rémi Verschelde 59c19a7172
Merge pull request #75250 from bruvzg/lbl_rtl_jst_flags
Expose TextServer justification flags to Label, Label3D, TextMesh and RTL. Add flags to control last/single line justification.
2023-05-16 10:48:45 +02:00
bruvzg 9163d8c336
Expose TextServer justification flags to Label, Label3D, TextMesh and RTL. Add flags to control last/single line justification. 2023-05-15 19:23:54 +03:00
Juan Linietsky 0a9f72d5a8 Make more base nodes thread safe
Ongoing work to make more of the base nodes thread safe.
2023-05-15 16:54:10 +02:00
Rémi Verschelde bbe05b60c8
Merge pull request #57179 from spacechase0/notify-world2d-changed-master
Propagate previously unused NOTIFICATION_WORLD_2D_CHANGED, make CanvasItem/CollisionObject2D use it
2023-05-08 16:40:00 +02:00
Max Hilbrunner fa451ead91
Merge pull request #74883 from dalexeev/fix-thin-multiline-colors 2023-05-05 14:26:37 +02:00
Chase Warrington 46e06ee1e6 Propogate previously unused NOTIFICATION_WORLD_2D_CHANGED, make CanvasItem/CollisionObject2D use it 2023-05-01 18:26:55 -04:00
kobewi 727a4ed79a Fix invalid global position when read outside tree 2023-04-18 22:14:01 +02:00
Yuri Sizov 377d8845da
Merge pull request #75890 from YuriSizov/gui-remember-window-state
Always cache parent visibility in `CanvasItem`
2023-04-18 13:07:41 +02:00
angel-721 e347d7d64d Rename internal root canvas group to start with underscore 2023-04-16 17:42:21 -06:00
Yuri Sizov fd6a743823 Always cache parent visibility in CanvasItem 2023-04-10 16:18:46 +02:00
Juan Linietsky 104392ef4e Remove NOTIFICATION_MOVED_IN_PARENT
* This notification makes node children management very inefficient.
* Replaced by a NOTIFICATION_CHILDREN_CHANGED (and children_changed signal).
* Changed Canvas code (and similar) to use the above signal, to perform more efficiently.

This PR breaks compatibility (although this notification was very rarely used, even within the engine), but provides an alternate way to do the same.
It is required for the changes in #75627 to be entirely effective.
2023-04-06 13:57:13 +02:00
kleonc 6e3820fd4d CanvasItem Fix ENTER_CANVAS / VISIBILITY_CHANGED notifications order when entering tree 2023-03-22 20:01:22 +01:00
Danil Alexeev ba985ecf3f
Fix `draw_multiline_colors()` for `width < 0` 2023-03-14 09:43:56 +03:00
bruvzg 7246b229e1
Set RTL minimal dash size to 2.0, add invalid dash size error to the `draw_dashed_line`. 2023-02-17 08:53:08 +02:00
bruvzg 4dfa161120
Add dash and step size checks to draw_dashed_line. 2023-02-16 17:49:18 +02:00
Danil Alexeev b8eda519d0
Optimize `draw_dashed_line()` and `draw_rect()` 2023-02-08 10:44:12 +03:00
Rémi Verschelde 82ff7b4bce
Merge pull request #68492 from Sauermann/fix-picking-sort
Fix propagation order for 2D physics picking events
2023-02-06 15:38:38 +01:00
Markus Sauermann 6e855e3820 Fix propagation order for 2D physics picking events
This patch adds a viewport-configuration-option for sorting
physics-picking events by the Z-Index and the scene tree position
of the collision objects.
2023-02-04 22:44:36 +01:00
Markus Sauermann 3bc426c9d8 Fix toplevel nomenclature
toplevel was 3.x
top_level is 4.x
2023-02-02 17:37:41 +01:00
Rémi Verschelde 394bb0ee2b
Fix various typos with codespell
Finally do the childs -> children rename too.
2023-02-01 08:45:41 +01:00
Rémi Verschelde 4cfdd25384
Merge pull request #67507 from Sauermann/fix-toplevel-root-control-node
Fix event propagation to child after set_as_toplevel
2023-01-31 15:55:46 +01:00
Rémi Verschelde 2e0d9efb72
Merge pull request #72115 from AThousandShips/clip_children_fix
Hide `clip_children` for some non-drawn CanvasItems
2023-01-30 10:02:54 +01:00
Ninni Pipping bbf203bc32 Hide clip_children for non-drawn CanvasItems 2023-01-30 08:22:06 +01:00
Rémi Verschelde 13e20fed99
Merge pull request #68627 from Sauermann/fix-tooltip-position
Fix position of Tooltips
2023-01-26 16:00:14 +01:00
Markus Sauermann c4ed247f5f Fix position of Tooltips
CanvasItem::get_screen_transform returns a transform from the CanvasItem
to the coordinate system, where a Popup - created as a child of the
CanvasItem - should be opened.
get_screen_transform makes some simplifications, that work well, when used
in the editor, but not in general cases.

Since Popups like Tooltips are now used more commonly in projects,
it becomes necessary to correct these simplifications.

This solution introduces Viewport::get_popup_base_transform, which makes
the necessary calculations.
2023-01-26 15:15:14 +01:00
Rémi Verschelde 229c82690d
Merge pull request #70294 from KoBeWi/treedulate
Add a method to get global modulate
2023-01-21 20:51:42 +01:00
Rémi Verschelde 9fc40123ab
Merge pull request #71679 from kleonc/draw_polyline_line_strip
`CanvasItem::draw_polyline` Support thin polylines drawn using line strip
2023-01-20 08:48:56 +01:00
Rémi Verschelde 360b61084a
Merge pull request #41239 from dalexeev/fix_draw_rect
Fix `CanvasItem.draw_rect` function with `filled = false`
2023-01-19 22:49:23 +01:00
kleonc 728c51e362 CanvasItem::draw_polyline Support thin polylines drawn using line strip 2023-01-19 21:08:25 +01:00
kleonc 43fc483e6c CanvasItem::draw_arc Clamp angle difference so arc won't overlap itself 2023-01-18 15:16:22 +01:00
Danil Alexeev c046bb8389
Fix `CanvasItem.draw_rect` function with `filled = false` 2023-01-17 09:15:47 +03:00
Danil Alexeev a8cbb6245b
Fix scaling issue in `draw_line` and similar methods 2023-01-16 12:49:58 +03:00
bruvzg 9b2843f14f
Improve dashed line alignment and make it optional. 2023-01-13 10:30:12 +02:00