# HG changeset patch # User Chris Cannam # Date 1169658864 0 # Node ID fcc043f75c41ea836f087a27b568476d73dcef32 # Parent 3ed71a9d578ba82d05ef191af458f1785a681388 * Avoid unnecessary work and updates when an invisible thumbwheel changes diff -r 3ed71a9d578b -r fcc043f75c41 view/Pane.cpp --- a/view/Pane.cpp Mon Jan 22 16:09:03 2007 +0000 +++ b/view/Pane.cpp Wed Jan 24 17:14:24 2007 +0000 @@ -62,6 +62,8 @@ { Profiler profiler("Pane::updateHeadsUpDisplay", true); + if (!isVisible()) return; + /* int count = 0; int currentLevel = 1; @@ -1591,6 +1593,9 @@ void Pane::zoomLevelChanged() { + std::cerr << "Pane[" << this << "]::zoomLevelChanged (global now " + << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << std::endl; + if (m_manager && m_manager->getZoomWheelsEnabled()) { updateHeadsUpDisplay(); } diff -r 3ed71a9d578b -r fcc043f75c41 widgets/Thumbwheel.cpp --- a/widgets/Thumbwheel.cpp Mon Jan 22 16:09:03 2007 +0000 +++ b/widgets/Thumbwheel.cpp Wed Jan 24 17:14:24 2007 +0000 @@ -141,7 +141,7 @@ bool changed = (m_mappedValue != mappedValue); m_mappedValue = mappedValue; m_noMappedUpdate = true; - std::cerr << "Thumbwheel::setMappedValue(" << mappedValue << "): new value is " << newValue << std::endl; + std::cerr << "Thumbwheel::setMappedValue(" << mappedValue << "): new value is " << newValue << " (visible " << isVisible() << ")" << std::endl; if (newValue != getValue()) { setValue(newValue); changed = true; @@ -167,7 +167,7 @@ Thumbwheel::setValue(int value) { std::cerr << "Thumbwheel::setValue(" << value << ") (from " << m_value - << ", rotation " << m_rotation << ")" << std::endl; + << ", rotation " << m_rotation << ")" << " (visible " << isVisible() << ")" << std::endl; if (m_value != value) { @@ -179,7 +179,7 @@ } m_rotation = float(m_value - m_min) / float(m_max - m_min); - update(); + if (isVisible()) update(); } void