diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-22 21:11:29 (GMT) |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-22 21:11:29 (GMT) |
commit | ae1c0c32a8ae463d144d81084fd6f1cdf50e643b (patch) | |
tree | b5514cbcdcd1908249c2fd5bc54e877771554be1 | |
parent | 58b4c3cd5ea796f31ae528652ee6d37e71bbd9f7 (diff) |
Optimise set_show_hints()
Only redraw the drawing area if something’s actually changed.
-rw-r--r-- | PascalTriangle.activity/pascaltriangle.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/PascalTriangle.activity/pascaltriangle.py b/PascalTriangle.activity/pascaltriangle.py index d5c3b6b..083693d 100644 --- a/PascalTriangle.activity/pascaltriangle.py +++ b/PascalTriangle.activity/pascaltriangle.py @@ -456,8 +456,9 @@ class PascalTriangleActivity(activity.Activity): def set_show_hints(self, val): """Set whether hints should be rendered.""" - self._show_hints = val - self._drawing_area.queue_draw() + if self._show_hints != val: + self._show_hints = val + self._drawing_area.queue_draw() show_hints = property(get_show_hints, set_show_hints) |