Bug 443361

Summary: Node.move() after rotation is acting out
Product: [Applications] krita Reporter: yetanotherpainter <bohdankornienko>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: halla
Priority: NOR    
Version: 4.4.8   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Krita system information

Description yetanotherpainter 2021-10-05 18:35:55 UTC
Created attachment 142177 [details]
Krita system information

SUMMARY

When running ratiotion and moving of node in script sometimes (in most cases is) node move horizontally (left, right) and down throws the node outside of the canvas.

Here the code snippet that should reproduce the issue:

```
from krita import Krita

import math


def main():
    app = Krita.instance()

    doc = app.activeDocument()

    active_layer = doc.activeNode()
    root_node = doc.rootNode()

    offsets = [
        (0, -32),
        (22, -22),
        (32, 0),
        (22, 22),
        (0, 32),
        (-22, 22),
        (-32, 0),
        (-22, -22)
    ]
    

    iters = 8
    for i, (x, y) in zip(range(iters), offsets):
        angle = math.pi * 2 / iters
        print(angle)

        leaf = active_layer.duplicate()
        root_node.addChildNode(leaf, None)
        leaf.rotateNode(i * angle)
        leaf.move(x, y)
        doc.waitForDone()
        doc.refreshProjection()
```

More on this here: https://krita-artists.org/t/node-move-is-acting-up/29958


System information is in attachment
Comment 1 yetanotherpainter 2021-10-05 18:54:07 UTC
Same behavior on  Version: 5.0.0-beta1 (git 9bd5348)
Weird teleportations on vertical and horizontal directions.
Comment 2 Halla Rempt 2022-07-12 13:44:46 UTC
I can confirm the issue (but the script only works if you call main() explicitly, it's not a plugin)