spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit a0ed5d62fdcd46b34b055c1c42001529c038e15c
parent df52ab83b6625328e7853179bbc11d8486f242de
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed,  7 Jul 2010 18:45:12 +1000

Re-analyse only if the window width has been changed

Diffstat:
Msrc/spek-spectrogram.vala | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala @@ -94,10 +94,14 @@ namespace Spek { queue_draw (); } + private int prev_width = -1; private override void size_allocate (Gdk.Rectangle allocation) { base.size_allocate (allocation); - if (file_name != null) { + bool width_changed = prev_width != allocation.width; + prev_width = allocation.width; + + if (file_name != null && width_changed) { start (); } }