Skip to content

Commit

Permalink
Merge b68c99a into ca06549
Browse files Browse the repository at this point in the history
  • Loading branch information
corranwebster committed Oct 29, 2014
2 parents ca06549 + b68c99a commit 697c1f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion chaco/abstract_colormap.py
@@ -1,6 +1,6 @@
""" Defines the base class for color maps
"""
from traits.api import Enum, HasTraits, Instance
from traits.api import Enum, Event, HasTraits, Instance

from data_range_1d import DataRange1D

Expand All @@ -15,6 +15,9 @@ class AbstractColormap(HasTraits):
# The color depth of the colors to use.
color_depth = Enum('rgba', 'rgb')

# A generic "update" event that generally means that anything that relies
# on this mapper for visual output should do a redraw or repaint.
updated = Event

def map_screen(self, val):
"""
Expand Down
7 changes: 6 additions & 1 deletion chaco/colormapped_scatterplot.py
Expand Up @@ -9,7 +9,7 @@

# Enthought library imports
from kiva.constants import STROKE
from traits.api import Dict, Enum, Float, Instance
from traits.api import Dict, Enum, Float, Instance, on_trait_change
from traitsui.api import Item, RangeEditor

# Local, relative imports
Expand Down Expand Up @@ -414,6 +414,11 @@ def _color_mapper_changed(self, old, new):

return

@on_trait_change('color_mapper:updated')
def _color_mapper_updated(self):
self.invalidate_draw()
self.request_redraw()

def _fill_alpha_changed(self):
self.invalidate_draw()
self.request_redraw()
Expand Down

0 comments on commit 697c1f7

Please sign in to comment.