Skip to content

Commit

Permalink
Merge pull request #2415 from reticulatus/ultimatelistctrl_rect_float…
Browse files Browse the repository at this point in the history
…s_fixes

UltimateListCtrl - Fix floor division so floats are not passed to wx.Rect()
  • Loading branch information
swt2c committed Jun 12, 2023
2 parents a5bb3d9 + e5fe26a commit 567eb5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wx/lib/agw/ultimatelistctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5265,7 +5265,7 @@ def OnPaint(self, event):
xAligned = x + cw - wLabel - HEADER_OFFSET_X

elif align == ULC_FORMAT_CENTER:
xAligned = x + wcheck + (cw - wLabel)/2
xAligned = x + wcheck + (cw - wLabel)//2

# if we have an image, draw it on the right of the label
if imageList:
Expand Down Expand Up @@ -5603,7 +5603,7 @@ def HandleColumnCheck(self, column, pos):

w, h = self.GetClientSize()
ix, iy = self._owner.GetCheckboxImageSize()
rect = wx.Rect(theX + HEADER_OFFSET_X, HEADER_OFFSET_Y + (h - 4 - iy)/2, ix, iy)
rect = wx.Rect(theX + HEADER_OFFSET_X, HEADER_OFFSET_Y + (h - 4 - iy)//2, ix, iy)

if rect.Contains(pos):
# User clicked on the checkbox
Expand Down

0 comments on commit 567eb5f

Please sign in to comment.