From a7a3daaf04a5a5322166d666009efc6b300db44d Mon Sep 17 00:00:00 2001 From: bhendrix Date: Thu, 15 Apr 2010 18:27:16 +0000 Subject: [PATCH] added trait for configuring how much non-selected lines get dimmed --- enthought/chaco/tools/legend_highlighter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/enthought/chaco/tools/legend_highlighter.py b/enthought/chaco/tools/legend_highlighter.py index 89e365ac2..48abdcc00 100644 --- a/enthought/chaco/tools/legend_highlighter.py +++ b/enthought/chaco/tools/legend_highlighter.py @@ -2,7 +2,7 @@ # ETS imports from enthought.chaco.tools.api import LegendTool -from enthought.traits.api import List +from enthought.traits.api import List, Float def get_hit_plots(legend, event): @@ -35,6 +35,8 @@ class LegendHighlighter(LegendTool): """ drag_button = "right" + + dim_factor = Float(3.0) # The currently selected renderers _selected_renderers = List @@ -94,8 +96,7 @@ def _set_states(self, plots): plot.line_width = plot._orig_line_width * 2.0 plot.alpha = plot._orig_alpha else: - plot.alpha = min(plot._orig_alpha * 3.0, 1.0) - plot.alpha = plot._orig_alpha / 3.0 + plot.alpha = plot._orig_alpha / self.dim_factor plot.line_width = plot._orig_line_width / 2.0 # Move the selected renderers to the front if len(self._selected_renderers) > 0: