Optimized some events in WaveCanvas method