Skip to content

Commit

Permalink
Fix Freeseer#663 Selecting a desktop record region does not always work
Browse files Browse the repository at this point in the history
  • Loading branch information
farazs committed Nov 22, 2014
1 parent 52a9c15 commit b29bb50
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/freeseer/plugins/videoinput/desktop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,26 @@ def area_select(self):
self.widget.window().hide()

def areaSelectEvent(self, start_x, start_y, end_x, end_y):
self.config.start_x = start_x
self.config.start_y = start_y
self.config.end_x = end_x
self.config.end_y = end_y
if start_x <= end_x:
self.config.start_x = start_x
self.config.end_x = end_x
else:
self.config.start_x = end_x
self.config.end_x = start_x

if start_y <= end_y:
self.config.start_y = start_y
self.config.end_y = end_y
else:
self.config.start_y = end_y
self.config.end_y = start_y

self.config.save()
log.debug('Area selector start: %sx%s end: %sx%s', start_x, start_y, end_x, end_y)
log.debug('Area selector start: %sx%s end: %sx%s',
self.config.start_x,
self.config.start_y,
self.config.end_x,
self.config.end_y)
# Automatically check the "Record Region" button.
self.set_desktop_area()
self.widget.areaButton.setChecked(True)
Expand Down

0 comments on commit b29bb50

Please sign in to comment.