Skip to content

to_data() method of Graph Gives Incorrect Results #10

Open
@DaytonaJohn

Description

I want to do some interacting with a plot. If the Graph widget is positioned in a layout at other than pos_hint = ('x': 0, 'y':0), then the to_data() method gives incorrect results. Also, the collide_plot() method gives incorrect results under the same circumstances. To reproduce, use the code in the below zip file and left click anywhere in the plot. If you click on the center of the plot(50,0), here is the output:

got a touch: <MouseMotionEvent spos=(0.5675, 0.5316666666666667) pos=(454.0, 319.00000000000006)>
graph.view_size = (658.0, 535.0)
graph.view_pos = (45.0, 51.0)
collide = True
point is at [62.1580547112462, 0.0018691588785049174]

I believe that the point output above should be close to (50,0). This works perfectly if the graph is located in the FloaLlayout at x=0, y=0.

Other than this bug, This is working great, thanks!!

bug.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions