Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions friture/spectrogram_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ def resize(self, width, height):
self.pixmap = self.pixmap.scaled(2 * width, height, QtCore.Qt.IgnoreAspectRatio, QtCore.Qt.SmoothTransformation)

def setcanvas_height(self, canvas_height):
if self.canvas_height != int(canvas_height):
self.canvas_height = int(canvas_height)
canvas_height = max(1, int(canvas_height))
if self.canvas_height != canvas_height:
self.canvas_height = canvas_height
self.resize(self.canvas_width, self.canvas_height)
self.logger.info("Spectrogram image: canvas_height changed, now: %d", int(canvas_height))

def setcanvas_width(self, canvas_width):
if self.canvas_width != int(canvas_width):
self.canvas_width = int(canvas_width)
canvas_width = max(1, int(canvas_width))
if self.canvas_width != canvas_width:
self.canvas_width = canvas_width
self.resize(self.canvas_width, self.canvas_height)
self.canvasWidthChanged.emit(int(canvas_width))
self.logger.info("Spectrogram image: canvas_width changed, now: %d", int(canvas_width))
Expand Down