How to achieve Slide In Overlay affect using Switch Transition with 'in-out' mode in react-transition-group - react-transition-group

In the 'in-out' mode the next child component position is should be the same as old child throughout the transition
Expecting a solution for overlapping the positions old and new child components in 'in-out' mode

Related

Whenever I move the camera on the left side of the screen, the cursor appears in-game. Unreal engine 5

The issue.
The mouse keeps escaping the full-screen whenever I either jump, move, rotate the camera or keep spinning to the left. But only on the left side of the screen, not the right, not the middle, not beneath, only on the left side.
This has happened in other unreal engine 5 games as well, but not in every single one of them.
What I've tried so far is:
Disabled Set bSHowMouseCursor nodes. [No effect.]
Set an Event BeginPlay > Set Input Mode Game only > Get Player Controller > Set SHow Mouse Cursor (Unchecked) [No effect.]
Created a new template (A blank one), then packaged it for testing. [Mixed effects. It slightly reduced the rate the mouse showed on the left side of the screen.]
Set an Event BeginPlay > Set Input Mode Game and UI > Get Player Controller > Set SHow Mouse Cursor (Unchecked) [Mixed results - I had to hold right click in order to move the camera, in which case, the mouse stopped showing, but as soon as I released it, the left mouse not only did appear as well, but the camera could not be moved and the cursor appeared permanently on the left side of the screen.]
Changed both the software and hardware cursors. But the cursor is unchanged. So it's not the game's cursor that appears in-game. It's the actual windows cursor.
I tested every option in the Default Viewport Mouse Lock Mode.
Deleted both Saved and the Intermediate folders.
Someone told me it has something to do with how the mouse is locked (or not) on viewport. And that, that might be the reason behind the cursor leaving escaping full-screen.
I don't have two monitors. The game is in full-screen. The issue persists in windowed mode as well. No widgets.
Tested it in packaging and in a Standalone game. (Issue persisted.)
The issue happens only if I click the left mouse button. If I play the game without clicking it, the cursor does not appear in-game.
Update:
It appears like going to the game's exe's compatibility and changing the high DPI settings' scaling behavior to application fixes the problem but reduces the fps. This is a temporary fix but I need a permanent one.
This is a weird issue.
What is on your left side desktop?
Do you use any apps that have an overlay?
If you have any apps try to disable them temporarily at startup from task manager, restart and check again.
In UE5, have you tried setting the mousecapture to true, especially in fullscreen.
Sometimes the mouse can escape...
Are you using a standard resolution/aspect ratio?
Some non standard resolutions and aspect ratios can change the way the base OS responds to captured/non captured input.

Will the device context of a child window have the same text metrics and text extents as its parents (up to GA_ROOT) with the same HFONT?

Right now I have code to manually compute the dialog base units for a non-dialog; these calculations involve getting a window's HDC and extracting the text metrics for that HDC as well as the text extents for the base X unit. This is used by parent controls that arrange and lay out children in a line, grid, etc.; the DLUs are used to conform to the sizing specifications provided by Microsoft in their (old) UI guidelines (not sure what the new ones say, if anything).
However, my code right now is run on every parent window for every child window in the window tree. Not only is this inefficient, but it's also inconsistent: do I calculate the base units for the child or its parent when computing the size the child wants to be? (All children have the same font as the parent.)
I could optimize this by assuming that if I select the same font into the HDC of a parent and the HDC of a child, the text extents and metrics will be identical. If this is true, then I can simply get these base units once, for the toplevel window that hosts all these children controls (GetAncestor(GA_ROOT)), and then use them through the entire control layout process. So is this true?
If that is true, under what conditions will the values be likely to change, DPI/monitor change only? Or something else?
And if that is not true, whose (parent's or child's) window dialog base units do I get for what (position and size)?
(Note: I'm talking about parents and children, not owners and owned windows.)
Thanks.

How do I make two NSWindow appear to have the same order?

I have two NSWindows, one of which is the child of the other. Basically what I want to accomplish is for the child to pop out and appear to extend the parent. If you like, think of it as opening a book: the cover flips out and ends up at the same Z order as the title page.
However I have the problem that one of the windows is always casting a shadow on the other. Is there any way to have them be on the same Z, so that neither casts a shadow on the other, but both cast shadows on windows below them?
Could this work? Take your existing child window, and remove the shadow with a setShadow:false call. Meanwhile create a third dummy window Z-ordered behind the two existing windows. Make it so that this window is always the same size and shape as the true child window and leave the shadow on.
Two possible problems with this: (1) a weird 'double shadow' at the point(s) where the two shadows intersect. (2) The shadow that the window with the focus casts is much larger than the shadow that windows without the focus cast. So if focus shifts between your two windows, the shadow might change size. Not sure how you'd get around that problem.
Otherwise your only choice may be to put both your windows with shadows turned off in a yucky container window which casts the one shadow. This would be a pretty radical UI change, but in my experience apps that tinker with the default appearance of their application's 'outer edge' or try to code their own partial transparency without using OS features rarely run smoothly.

Do CSS3 transitions delay event capture/bubbling?

As you can see in this example, setting a :hover behavior for an element seems to delay its state from being recognized by its child elements.
For example this HTML,
<p>Here's some text.
<span>This will highlight later.</span>
Here's some more text.</p>
with CSS:
p:hover{
color:#FE6
}
p,span{
-webkit-transition-property:all;
-webkit-transition-duration:1s;
-moz-transition-property:all;
-moz-transition-duration:1s;
-o-transition-property:all;
-o-transition-duration:1s;
}
Makes the span begin its transition at the conclusion of the transition of the parent element. Is this by design, or, is this documented as a bug?
I believe what happens is this:
Starting of transitions
When the value of an animatable property changes, implementations must
decide what transitions to start based on the values of the
‘transition-property’, ‘transition-duration’,
‘transition-timing-function’, and ‘transition-delay’ properties at the
time of the change. Since this specification does not define what
property changes are considered simultaneous, authors should be aware
that changing any of the transition properties a small amount of time
after making a change that might transition can result in behavior
that varies between implementations, since the changes might be
considered simultaneous in some implementations but not others.
Once the transition of a property has started, it must continue
running based on the original timing function, duration, and delay,
even if the ‘transition-timing-function’, ‘transition-duration’, or
‘transition-delay’ property changes before the transition is complete.
However, if the ‘transition-property’ property changes such that the
transition would not have started, the transition must stop (and the
property must immediately change to its final value).
Implementations must not start a transition when the computed value of
a property changes as a result of declarative animation (as opposed to
scripted animation).
Implementations also must not start a transition when the computed
value changes because it is inherited (directly or indirectly) from
another element that is transitioning the same property.
http://www.w3.org/TR/css3-transitions/#the-transition-property-property-
Since you are specifying the selector as p, span and span is nested inside p the change of color in p stops the span and makes it delay.
Note that color is inherited so you don't need to specify it on both elements - p is enough.

How to make selection on QGraphicsScene?

I'm writing a diagram editor in Qt with Graphics View Framework.
Currently I'm just trying to create a simple Node (QGraphicsItem) on GraphScene (QGraphicsScene). I created a Canvas (QGraphicsView) and added a grid to it. I can even add Nodes and move them around on scene. My final goal is to have different working modes, editing and styling options, etc. For now I just want to know how can I setup selection for Nodes already present on scene. I tried doing it with mouse events but noticed that event calls for selection and Node insertion overlap... When I try to select something a new Node is created... This is my first Qt application so I don't fully understand how the functionality I want to achieve should be designed.
How the Selection Rectangle should be properly drawn?
How should I manage mouse events that conflict with each other?
You can use a checkable button/action(that's a QPushButton/QAction with a checkable property set to 'true) to switch between Edit & Insert mode. Then you check the state in your mouse event and insert a new item only if you're in Insertion mode.
You can also distinct between mouse buttons - insert item when dragged with the right button for example
Or use QKeyboardModifiers - for example: on drag + Ctrl - insert item.
Hope this helps.
In case of the overlapping mouse events, you should have a single place (like QGraphicsView to handle the mouse clicking/moving events) and create a state machine and then handle the events according to the state you are in. You need to plan your architecture well and that can be really complex task.
set your state enum/constants
refer to the current machine state in your events in your if conditions
keep your "business logic" on a single place
Like it's shown in these two NodeEditor tutorials #11 and #12: https://www.youtube.com/watch?v=pk4v2xuXlm4 and https://www.youtube.com/watch?v=-VYcQojkloE)
If you still want more in depth explanation of the functionality and events of Qt, here is a full list of tutorials with implementing all possible features like dragging edges to nodes, selecting them and deleting them, cutting edges, serialization, etc., you can have a look on the whole list of 50 tutorials I've recorded here: https://www.blenderfreak.com/tutorials/node-editor-tutorial-series/.
I'm putting a link to the whole list, since it's not possible to write all the code on this page...

Resources