Opened 6 years ago

Closed 6 years ago

#16425 closed defect (fixed)

Fix bugs in plot library and make it ready for NumPy 1.9

Reported by: florian Owned by:
Priority: normal Milestone:
Component: wxPython Version: 3.0.1
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

This is a compound patch that fixes the following issues:

  • The oldnumeric module will be dropped in NumPy 1.9. Making plot compatible with current stable NumPy 1.8.x and NumPy 1.9.x is fortunately easy, and this patch contains the necessary bits.
  • Font size scaling for wxPython >= 2.9 under Linux when using anti-aliasing (was too large).
  • When using a fixed number of tick marks and zooming in, there may be no ticks to display, which caused unhandled exception.
  • TypeError in OnScroll because self._sb_xfullrange and self._sb_yfullrange are numbers.
  • Point label under certain circumstances being drawn multiple times. This was hard to track down: The cause turned out to be that at some occasions when the mouse leaves and re-enters the canvas, OnPaint was called (and called multiple times). I tracked this down to other widgets being hovered, in this case a BitmapButton, on the same window causing OnPaint to be fired when the hover state was animated (like it is by default under KDE), and when the mouse then rapidly moves back into the canvas, it receives the OnPaint event. That in itself shouldn't cause issues though, as OnPaint is supposed to remove the old point label. The underlying issue was that it does so in the buffered DC, while the new point label is drawn over the client DC. The solution I came up with is to use the buffered client DC when drawing the point label.
  • I also removed a call to the deprecated wx.InitAllImageHandlers.

The patch is backwards compatible with wxPython 2.8.x.

Attachments (1)

plot.py.patch download (4.7 KB) - added by florian 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by florian

comment:1 in reply to: ↑ description Changed 6 years ago by florian

  • Point label under certain circumstances being drawn multiple times. [...] The underlying issue was that it does so in the buffered DC, while the new point label is drawn over the client DC.

Got that wrong. The underlying issue was that OnPaint caused the point label to be removed in the client DC, but then draws the buffer to the screen which still contains the old point label.

comment:2 Changed 6 years ago by robind

See also #16590. Looks like there is some overlap between this and that patch that will need to be dealt with.

comment:3 Changed 6 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed by #16590

Note: See TracTickets for help on using tickets.