Skip to content

Commit

Permalink
Fixing unused calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Aug 28, 2021
1 parent b2d9585 commit 9a9c4ad
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/windows/video_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,14 +1143,15 @@ def delayed_resize_callback(self):
project_size = QSize(get_app().project.get("width"), get_app().project.get("height"))
project_size.scale(self.delayed_size, Qt.KeepAspectRatio)

# Calculate height/width divisible by 2 (if valid height)
if project_size.height() > 0:
# Ensure width and height are divisible by 2
ratio = float(project_size.width()) / float(project_size.height())
width = round(project_size.width() / 2.0) * 2
height = (round(width / ratio) / 2.0) * 2
even_width = round(project_size.width() / 2.0) * 2
even_height = round(round(even_width / ratio) / 2.0) * 2
project_size = QSize(even_width, even_height)

# Emit signal that video widget changed size
self.win.MaxSizeChanged.emit(project_size)
# Emit signal that video widget changed size
self.win.MaxSizeChanged.emit(project_size)

# Capture wheel event to alter zoom/scale of widget
def wheelEvent(self, event):
Expand Down

0 comments on commit 9a9c4ad

Please sign in to comment.