Fix Gizmos not drawing On<Pointer<Drag>>, Observers generally, and Triggered Systems#22800
Open
kfc35 wants to merge 1 commit intobevyengine:mainfrom
Open
Fix Gizmos not drawing On<Pointer<Drag>>, Observers generally, and Triggered Systems#22800kfc35 wants to merge 1 commit intobevyengine:mainfrom
On<Pointer<Drag>>, Observers generally, and Triggered Systems#22800kfc35 wants to merge 1 commit intobevyengine:mainfrom
Conversation
84e5413 to
858c8d6
Compare
kfc35
commented
Feb 4, 2026
|
|
||
| #[expect( | ||
| unused_mut, | ||
| reason = "The `world` parameter is unused for zero-length tuples; however, it must be mutable for other lengths of tuples." |
Contributor
Author
There was a problem hiding this comment.
I copied this from the macro rule for impl_system_param_tuple since it was complaining here too
On<Pointer<Drag>> (maybe Observers in general?)On<Pointer<Drag>> (maybe Observers in general?)
On<Pointer<Drag>> (maybe Observers in general?)On<Pointer<Drag>>, Observers generally, and Triggered Systems)
On<Pointer<Drag>>, Observers generally, and Triggered Systems)On<Pointer<Drag>>, Observers generally, and Triggered Systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Solution
queue()for both theGizmosSystemParamand theGizmoBufferSystemBuffer. Its body is the same asapply()except it acts onDeferredWorld.Gizmossystem parameter never hadapply()called on it when it was being used within an observer, which was why its internalSystemBuffer(GizmoBuffer) kept growing indefinitely. I saw thatSystemParam’s also have aqueue()function and was curious whether that was being called instead… and it was! So, I just implementedqueue()in the same way thatapply()was (after making sure it was OK to use aDeferredWorldin that way… and seems like it is OK?), and it solves the issue.Deferreddoesn't seem to work with observers #14597 , where the solution described there as well is to implementapply()Testing
The reproduction example in #22485 works now. A white square gizmo is drawn in the center if you drag inside the window.
I also tested against the examples in #14566 (both of them) and #19119 and the missing gizmos are drawn.