Merge pull request #2436 from jmoraleda/freezeto-gridlabelrenderer

Bugfix. Display correct labels in GridWithLabelRenderersMixin when the grid contains frozen rows or columns
This commit is contained in:
Scott Talbert
2023-07-11 19:15:29 -04:00
committed by GitHub

View File

@@ -95,12 +95,14 @@ class GridWithLabelRenderersMixin(object):
def _onPaintRowLabels(self, evt):
window = evt.GetEventObject()
dc = wx.PaintDC(window)
gridWindow = self.GetGridWindow()
rows = self.CalcRowLabelsExposed(window.GetUpdateRegion())
rows = self.CalcRowLabelsExposed(window.GetUpdateRegion(), gridWindow)
if rows == [-1]:
return
x, y = self.CalcUnscrolledPosition((0,0))
offset = self.GetGridWindowOffset(gridWindow)
x, y = self.CalcUnscrolledPosition(offset)
pt = dc.GetDeviceOrigin()
dc.SetDeviceOrigin(pt.x, pt.y-y)
for row in rows:
@@ -119,12 +121,14 @@ class GridWithLabelRenderersMixin(object):
def _onPaintColLabels(self, evt):
window = evt.GetEventObject()
dc = wx.PaintDC(window)
gridWindow = self.GetGridWindow()
cols = self.CalcColLabelsExposed(window.GetUpdateRegion())
cols = self.CalcColLabelsExposed(window.GetUpdateRegion(), gridWindow)
if cols == [-1]:
return
x, y = self.CalcUnscrolledPosition((0,0))
offset = self.GetGridWindowOffset(gridWindow)
x, y = self.CalcUnscrolledPosition(offset)
pt = dc.GetDeviceOrigin()
dc.SetDeviceOrigin(pt.x-x, pt.y)
for col in cols: