mirror of
https://github.com/alexkay/spek.git
synced 2025-06-09 03:42:32 +03:00
Fix crash on OS X when the window is too small
This commit is contained in:
parent
c64475f36e
commit
21d2d447c5
@ -209,7 +209,7 @@ void SpekSpectrogram::render(wxDC& dc)
|
|||||||
TPAD - 2 * GAP - normal_height - small_height
|
TPAD - 2 * GAP - normal_height - small_height
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this->image.GetHeight() > 1) {
|
if (this->image.GetWidth() > 1 && this->image.GetHeight() > 1) {
|
||||||
// Draw the spectrogram.
|
// Draw the spectrogram.
|
||||||
wxBitmap bmp(this->image.Scale(w - LPAD - RPAD, h - TPAD - BPAD));
|
wxBitmap bmp(this->image.Scale(w - LPAD - RPAD, h - TPAD - BPAD));
|
||||||
dc.DrawBitmap(bmp, LPAD, TPAD);
|
dc.DrawBitmap(bmp, LPAD, TPAD);
|
||||||
@ -274,6 +274,7 @@ void SpekSpectrogram::render(wxDC& dc)
|
|||||||
dc.DrawRectangle(LPAD, TPAD, w - LPAD - RPAD, h - TPAD - BPAD);
|
dc.DrawRectangle(LPAD, TPAD, w - LPAD - RPAD, h - TPAD - BPAD);
|
||||||
|
|
||||||
// The palette.
|
// The palette.
|
||||||
|
if (h - TPAD - BPAD > 0) {
|
||||||
wxBitmap bmp(this->palette.Scale(RULER, h - TPAD - BPAD + 1));
|
wxBitmap bmp(this->palette.Scale(RULER, h - TPAD - BPAD + 1));
|
||||||
dc.DrawBitmap(bmp, w - RPAD + GAP, TPAD);
|
dc.DrawBitmap(bmp, w - RPAD + GAP, TPAD);
|
||||||
|
|
||||||
@ -297,6 +298,7 @@ void SpekSpectrogram::render(wxDC& dc)
|
|||||||
);
|
);
|
||||||
density_ruler.draw(dc);
|
density_ruler.draw(dc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void pipeline_cb(int sample, float *values, void *cb_data)
|
static void pipeline_cb(int sample, float *values, void *cb_data)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user