Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph doesn't register events if the size of the graph is greater than the window #71

Open
jennm opened this issue Jan 10, 2021 · 0 comments

Comments

@jennm
Copy link

jennm commented Jan 10, 2021

If a graph is made to be larger than the size of the window, then each point within the graph isn't reliably registered to be within the graph. If the portion of the screen visible to the user is such that the bottom left corner's coordinates are (0, 0), the graph works as expected, if it is not, sometimes the point is registered to be within the graph and other times it is not.
This issue can be corrected by modifying the _to_widget function within the FigureCanvasKivy class so that instead of recursively going to the parent widget until the "initial" widget is reached, we stop at the parent of the current widget. This corrects the issue because in some circumstances going to the "initial" widget causes the y position of the cursor to be modified incorrectly. Stopping at the parent of the current widget prevents this modification from occurring incorrectly.

Adding this function should correct this issue.
def _to_widget(self, x, y, relative=False):

    if self.parent:
        return self.parent.to_local(x, y, relative=relative)
    return self.to_local(x, y, relative=relative)

I've made these changes on my local copy, but I'm not sure how to proceed in making these changes on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant