Bug 443361 - Node.move() after rotation is acting out
Summary: Node.move() after rotation is acting out
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.4.8
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-05 18:35 UTC by yetanotherpainter
Modified: 2022-07-12 13:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Krita system information (2.54 KB, text/plain)
2021-10-05 18:35 UTC, yetanotherpainter
Details

Note You need to log in before you can comment on or make changes to this bug.
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)