Dragging of rotated windows is entirely incorrect

Issue #1071 new
Lukas Meindl created an issue

Operating System: Windows 7 64-bit

Dragging rotated windows (framewindows) leads to crazy movements (probably related to unproject() ? )

The bug is present in default branch. Needs to be tested in v0-8 as well.

Reproducibility: always
(If reproducable:)
Reproduction steps:
1. Replace the dragDropDemo for example with this:

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout version="4" >
    <Window type="DefaultWindow" name="Root" >
        <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Property name="MaxSize" value="{{1,0},{1,0}}" />
        <Window type="WindowsLook/FrameWindow" name="MainWindow" >
            <Property name="Area" value="{{0.25,0},{0.25,0},{0.75,0},{0.75,0}}" />
            <Property name="Text" value="Drag and Drop Demo" />
            <Property name="Rotation" value="w:0.742404 x:0.346189 y:0.519837 z:-0.242404" />
            <Property name="RollUpEnabled" value="false" />
            <Property name="SizingEnabled" value="false" />
            <Window type="WindowsLook/Static" name="Slot1" >
                <Property name="Area" value="{{0.05,0},{0.05,0},{0.25,0},{0.31,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
                <Window type="DragContainer" name="DragContainer1" >
                    <Property name="Area" value="{{0.05,0},{0.05,0},{0.95,0},{0.95,0}}" />
                    <Property name="StickyMode" value="false" />
                    <Window type="WindowsLook/StaticImage" name="Image" >
                        <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
                        <Property name="MaxSize" value="{{1,0},{1,0}}" />
                        <Property name="MousePassThroughEnabled" value="true" />
                    </Window>
                </Window>
            </Window>
            <Window type="WindowsLook/Static" name="Slot2" >
                <Property name="Area" value="{{0.283,0},{0.05,0},{0.483,0},{0.31,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot3" >
                <Property name="Area" value="{{0.516,0},{0.05,0},{0.716,0},{0.31,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot4" >
                <Property name="Area" value="{{0.749,0},{0.05,0},{0.949,0},{0.31,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot5" >
                <Property name="Area" value="{{0.05,0},{0.37,0},{0.25,0},{0.63,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot6" >
                <Property name="Area" value="{{0.283,0},{0.37,0},{0.483,0},{0.63,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
                <Window type="DragContainer" name="DragContainer2" >
                    <Property name="Area" value="{{0.05,0},{0.05,0},{0.95,0},{0.95,0}}" />
                    <Property name="StickyMode" value="false" />
                    <Window type="WindowsLook/StaticImage" name="Image" >
                        <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
                        <Property name="MaxSize" value="{{1,0},{1,0}}" />
                        <Property name="MousePassThroughEnabled" value="true" />
                    </Window>
                </Window>
            </Window>
            <Window type="WindowsLook/Static" name="Slot7" >
                <Property name="Area" value="{{0.516,0},{0.37,0},{0.716,0},{0.63,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot8" >
                <Property name="Area" value="{{0.749,0},{0.37,0},{0.949,0},{0.63,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot9" >
                <Property name="Area" value="{{0.05,0},{0.69,0},{0.25,0},{0.95,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot10" >
                <Property name="Area" value="{{0.283,0},{0.69,0},{0.483,0},{0.95,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot11" >
                <Property name="Area" value="{{0.516,0},{0.69,0},{0.716,0},{0.95,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
            <Window type="WindowsLook/Static" name="Slot12" >
                <Property name="Area" value="{{0.749,0},{0.69,0},{0.949,0},{0.95,0}}" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
            </Window>
        </Window>
    </Window>
</GUILayout>
  1. Start the SampleBrowser, select the demo
  2. Drag the rotated FrameWindow

Comments (3)

  1. Paul Turner

    Just a note to say that this will almost certainly be related to the unproject function. As far as I recall the only time hit testing and moving of rotated content worked at all was in v0-7, and even then it was flaky.

  2. Lukas Meindl reporter

    Good, that confirms my assumptions in the description. The unproject function in general also requires some intense calculations, maybe it is therefore not an optimal solution especially as it can cause recursive calls for all hit children if I understand correctly. On the other hand it is only used for actions such as dragging operations in framewindows anyways. If only 4 or 5 calls on average are required for such actions per update then it should be acceptable. I can't think of a good alternative anyways, except maybe screen space bounding planes, but that would require quite some extra stuff.

    Probably it is best to just fix the function (when we have time (TM)). Too bad we don't know what broke it but maybe a diff from v0-7 to v0-8 might help.

  3. Paul Turner

    Even in v0-7 it was not correct, mostly is appeared to work, but then there were some cases where it did totally the wrong thing. I believe this is the function that I (so i'm told!) told you to just pass back out the input values and we'd get to it later (since it was not working correctly in all cases anyway). And that's what happened.

    I think overall, if it was working, the perf hit is managable due to the fact it's not something that would be used heavily (especially not, for example, rotated content on rotated content that rotates). That said, you are right that it is a comparitively expensive thing to do.

  4. Log in to comment