spek

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

commit 81fa01056a31cba1257b41a0b3db6dd1cd818efc
parent 12871fb2713b43c1ab3c9f1b124798be9b9fc548
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed,  5 Sep 2012 10:06:31 -0700

osx: Fix a crash when the window is too small

Diffstat:
Msrc/spek-spectrogram.cc | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -209,7 +209,8 @@ void SpekSpectrogram::render(wxDC& dc) TPAD - 2 * GAP - normal_height - small_height ); - if (this->image.GetWidth() > 1 && this->image.GetHeight() > 1) { + if (this->image.GetWidth() > 1 && this->image.GetHeight() > 1 && + w - LPAD - RPAD > 0 && h - TPAD - BPAD > 0) { // Draw the spectrogram. wxBitmap bmp(this->image.Scale(w - LPAD - RPAD, h - TPAD - BPAD)); dc.DrawBitmap(bmp, LPAD, TPAD);