nodebox / live

Report issues with NodeBox Live
1 stars 0 forks source link

mousePosition Node not working as expected #36

Open craftoid opened 7 years ago

craftoid commented 7 years ago

The mouse position seems to be off:

mouse-anim

Expected Behaviour

The mouse position should be computed relative to the origin.

Observed Behaviour

The mouse position seems to be computed relative to the bottom right corner of screen

mouse-2-anim

Project JSON

{
    "title": "issues",
    "color": "teal",
    "dependencies": {
        "core/g": "dev"
    },
    "assets": {},
    "functions": [
        {
            "name": "main",
            "type": "network",
            "renderedNode": "combine1",
            "nodes": [
                {
                    "name": "mousePosition1",
                    "x": 5,
                    "y": 85,
                    "fn": "g.mousePosition"
                },
                {
                    "name": "ellipse1",
                    "x": 5,
                    "y": 305,
                    "fn": "g.ellipse",
                    "values": {}
                },
                {
                    "name": "groupBy1",
                    "x": 155,
                    "y": 195,
                    "fn": "g.groupBy",
                    "values": {
                        "key": ""
                    }
                },
                {
                    "name": "text1",
                    "x": 155,
                    "y": 305,
                    "fn": "g.text",
                    "values": {
                        "fontSize": 16
                    }
                },
                {
                    "name": "combine1",
                    "x": 5,
                    "y": 485,
                    "fn": "g.combine"
                },
                {
                    "name": "colorize1",
                    "x": 155,
                    "y": 385,
                    "fn": "g.colorize",
                    "values": {
                        "fill": "rgba(255, 255, 255, 1)"
                    }
                }
            ],
            "connections": [
                {
                    "output": "mousePosition1",
                    "input": "ellipse1",
                    "parameter": "position"
                },
                {
                    "output": "mousePosition1",
                    "input": "groupBy1",
                    "parameter": "data"
                },
                {
                    "output": "groupBy1",
                    "input": "text1",
                    "parameter": "text"
                },
                {
                    "output": "mousePosition1",
                    "input": "text1",
                    "parameter": "position"
                },
                {
                    "output": "ellipse1",
                    "input": "combine1",
                    "parameter": "list1"
                },
                {
                    "output": "text1",
                    "input": "colorize1",
                    "parameter": "shape"
                },
                {
                    "output": "colorize1",
                    "input": "combine1",
                    "parameter": "list2"
                }
            ],
            "parameters": [],
            "returnsList": true,
            "async": true
        }
    ],
    "id": "issues"
}