Skip to content

Commit

Permalink
Fixed crashes in bitmap editor and map editor with empty documents
Browse files Browse the repository at this point in the history
  • Loading branch information
robmcmullen committed May 1, 2016
1 parent f05de3e commit 6186a12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions omnivore/tasks/bitmap_edit/bitmap_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def init_post_hook(self):
def process_left_down(self, evt):
c = self.canvas
index, bit, inside = c.event_coords_to_byte(evt)
if not inside:
return
e = c.editor
value = e.segment[index]
if self.last_index != index:
Expand Down Expand Up @@ -455,6 +457,9 @@ def invert_selection_ranges(self, ranges):
ranges = self.segment.rects_to_ranges(inverted)
return ranges

def get_extra_segment_savers(self, segment):
return []

###########################################################################
# Trait handlers.
###########################################################################
Expand Down
5 changes: 5 additions & 0 deletions omnivore/tasks/map_edit/map_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def init_post_hook(self):
def process_left_down(self, evt):
c = self.canvas
index, bit, inside = c.event_coords_to_byte(evt)
if not inside:
return
e = c.editor
value = e.segment[index]
if self.last_index != index:
Expand Down Expand Up @@ -468,6 +470,9 @@ def invert_selection_ranges(self, ranges):
ranges = self.segment.rects_to_ranges(inverted)
return ranges

def get_extra_segment_savers(self, segment):
return []

###########################################################################
# Trait handlers.
###########################################################################
Expand Down

0 comments on commit 6186a12

Please sign in to comment.