This bug is ages old, but I’m reporting it again as I came across it again:

This bug is ages old, but I’m reporting it again as I came across it again:

items in script-created containers will not keep assigned on-grid positions if interacted with (e.g. when edit mode is entered on the container, or a script edits properties of the item).

Simplest reproducing script I found:

var c = getActiveScreen().getCurrentDesktop().addPanel(0,0,100,100).getContainer();

var s = c.addShortcut(“test”,new Intent(),0,0);

s.setCell(1,1,2,2);

Note that

– whether or not save() is called has no impact on this bug

– off-grid positions are kept

– I don’t know if only editing specific properties causes the “jump” back to 0/0, but going into edit mode does it for sure

]]>

4 Commentsto This bug is ages old, but I’m reporting it again as I came across it again:

  1. Anonymous says:

    < ![CDATA[

    What if you use the permanent setCell? (s.setCell(1,1,2,2,true/false))

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Oh man, I might’ve forgotten the ages old fix…

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Don’t worry, I also had the same mistake recently, that’s why I asked 😛

    ]]>

  4. Anonymous says:

    < ![CDATA[

    That’s the problem with badly design APIs: they can create bugs, even if they work correctly! The problem is that it’s not easy to change them, and there are at least 5 or 6 other APIs like this one.


    If I had time, I would add a switch, on by default, that would warn about unsafe method call.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *