Skip to content
Open
Changes from all commits
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
17 changes: 10 additions & 7 deletions PYME/DSView/arrayViewPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ def _draw_selection(self, view, dc):
pts = numpy.vstack(self.pixel_to_screen_coordinates(x, y)).T
dc.DrawSpline(pts.astype('i'))
elif self.do.selection.width == 1:
lx, ly, hx, hy = self.do.GetSliceSelection()
lx, ly = self.pixel_to_screen_coordinates(lx, ly)
hx, hy = self.pixel_to_screen_coordinates(hx, hy)
dc.DrawLine(int(lx),int(ly),int( hx),int(hy))
else:
lx, ly, hx, hy = self.do.GetSliceSelection()
Expand Down Expand Up @@ -762,7 +765,7 @@ def _on_set_position(self,event):

self.do.inOnChange = True
try:
self.do.xp, self.do.yp, self.do.zp = [int(p) for p in pos_3d]
self.do.xp, self.do.yp, self.do.zp = [int(round(p)) for p in pos_3d]
finally:
self.do.inOnChange = False

Expand Down Expand Up @@ -790,11 +793,11 @@ def _start_selection(self,event):
pos = self._evt_pixel_coords(event)

if (self.do.slice == self.do.SLICE_XY):
self.do.selection.start.x, self.do.selection.start.y = [int(p) for p in pos]
self.do.selection.start.x, self.do.selection.start.y = [int(round(p)) for p in pos]
elif (self.do.slice == self.do.SLICE_XZ):
self.do.selection.start.x, self.do.selection.start.z = [int(p) for p in pos]
self.do.selection.start.x, self.do.selection.start.z = [int(round(p)) for p in pos]
elif (self.do.slice == self.do.SLICE_YZ):
self.do.selection.start.y, self.do.selection.start.z = [int(p) for p in pos]
self.do.selection.start.y, self.do.selection.start.z = [int(round(p)) for p in pos]

self.do.selection.trace = []
self.do.selection.trace.append(tuple(pos))
Expand All @@ -811,11 +814,11 @@ def _progress_selection(self,event):
pos = self._evt_pixel_coords(event)

if (self.do.slice == self.do.SLICE_XY):
self.do.selection.finish.x, self.do.selection.finish.y = [int(p) for p in pos]
self.do.selection.finish.x, self.do.selection.finish.y = [int(round(p)) for p in pos]
elif (self.do.slice == self.do.SLICE_XZ):
self.do.selection.finish.x, self.do.selection.finish.z = [int(p) for p in pos]
self.do.selection.finish.x, self.do.selection.finish.z = [int(round(p)) for p in pos]
elif (self.do.slice == self.do.SLICE_YZ):
self.do.selection.finish.y, self.do.selection.finish.z = [int(p) for p in pos]
self.do.selection.finish.y, self.do.selection.finish.z = [int(round(p)) for p in pos]


if event.ShiftDown(): #lock
Expand Down
Loading