def _drawPointLabel(self, mDataDict):
"""Draws and erases pointLabels"""
width = self._Buffer.GetWidth()
height = self._Buffer.GetHeight()
if sys.platform != "darwin":
tmp_Buffer = wx.Bitmap(width, height)
dcs = wx.MemoryDC()
dcs.SelectObject(tmp_Buffer)
dcs.Clear()
else:
tmp_Buffer = self._Buffer.GetSubBitmap((0, 0, width, height))
dcs = wx.MemoryDC(self._Buffer)
self._pointLabelFunc(dcs, mDataDict) # custom user pointLabel function
dc = wx.ClientDC(self.canvas)
dc = wx.BufferedDC(dc, self._Buffer)
# this will erase if called twice
dc.Blit(0, 0, width, height, dcs, 0, 0, self._logicalFunction)
if sys.platform == "darwin":
self._Buffer = tmp_Buffer
评论列表
文章目录