Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed an integer type error in Ellipse
  • Loading branch information
ChrisBarker-NOAA committed Jan 4, 2024
commit 1404d03f965fc4bd1d60245634d2419348432709
3 changes: 2 additions & 1 deletion samples/floatcanvas/BB_HitTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"""
Test of an alternative hit test method that used the bounding boxes of the objects instead.

Poorly tested -- and broken on recent versions
Poorly tested -- and broken in recent versions

NOTE: probably the issue is different event IDs or something.

Edited from code contributed by Benjamin Jessup on the mailing list

Expand Down
6 changes: 3 additions & 3 deletions samples/floatcanvas/BNAEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ def __init__(self,parent, id,title,position,size):
BackgroundColor = "DARK SLATE BLUE"
).Canvas

wx.EVT_CLOSE(self, self.OnCloseWindow)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

self.Canvas.Bind(FloatCanvas.EVT_MOTION, self.OnMove )
self.Canvas.Bind(FloatCanvas.EVT_LEFT_UP, self.OnLeftUp )
self.Canvas.Bind(FloatCanvas.EVT_MOTION, self.OnMove)
self.Canvas.Bind(FloatCanvas.EVT_LEFT_UP, self.OnLeftUp)
self.Canvas.Bind(FloatCanvas.EVT_LEFT_DOWN, self.OnLeftDown)

try:
Expand Down
4 changes: 2 additions & 2 deletions wx/lib/floatcanvas/FCObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2466,10 +2466,10 @@ def _Draw(self, dc, Canvas):
if len(Points) > 100:
xy = Points
xywh = N.concatenate((xy-radius, N.ones(xy.shape) * self.Size ), 1 )
dc.DrawEllipseList(xywh)
dc.DrawEllipseList(xywh.astype(N.int32))
else:
for xy in Points:
dc.DrawCircle(xy[0],xy[1], radius)
dc.DrawCircle(xy[0], xy[1], radius)

class Arc(XYObjectMixin, LineAndFillMixin, DrawObject):
"""
Expand Down