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

Canvas.AddArrow from FloatCanvas does not work with WxPython 4.2.0 demo #2320

Open
dbressan2 opened this issue Dec 20, 2022 · 2 comments · May be fixed by #2448
Open

Canvas.AddArrow from FloatCanvas does not work with WxPython 4.2.0 demo #2320

dbressan2 opened this issue Dec 20, 2022 · 2 comments · May be fixed by #2448

Comments

@dbressan2
Copy link

Operating system: Windows 10 ENTREPRISE
wxPython version & source: 4.2.0
Python version & source: 3.10.6

Description of the problem:
Canvas.AddArrow from FloatCanvas does not work with WxPython demo using wxPython 4.2.0. No Arrow is actually drawn.

Same demo code works with wxPython 4.1.1.

@ChrisBarker-NOAA
Copy link

I tested on:
wxPython 4.2.1 with Python 3.9 on a Mac, and it works.

However, with:
wxPython 4.2.1 with Python 3.10 on a Mac

I do see the failure.

So it's a 2.9 vs 3.10 issue, which is very odd.

It *could be an issue with a new numpy -- I"ll see about fixing the numpy warnings, and see if that helps.

@ChrisBarker-NOAA ChrisBarker-NOAA linked a pull request Aug 21, 2023 that will close this issue
@ChrisBarker-NOAA
Copy link

Found it -- turns out wxPython used to simply truncate floats to int when you used them in a drawing call -- now it doesn't do that, and instead does mysterious things -- at least when using numpy arrays, which FloatCanvas makes heavy use of.

Anyway -- fixed in: #2448

However, I'm not sure when that might get merged -- I don't have permissions :-(

If you want to patch it yourself, you'll want the new FloatCanvas.py and DrawObjects.py

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

Successfully merging a pull request may close this issue.

2 participants