Skip to content

Commit 9a9c4ad

Browse files
committed
Fixing unused calculation
1 parent b2d9585 commit 9a9c4ad

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/windows/video_widget.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1143,14 +1143,15 @@ def delayed_resize_callback(self):
11431143
project_size = QSize(get_app().project.get("width"), get_app().project.get("height"))
11441144
project_size.scale(self.delayed_size, Qt.KeepAspectRatio)
11451145

1146-
# Calculate height/width divisible by 2 (if valid height)
11471146
if project_size.height() > 0:
1147+
# Ensure width and height are divisible by 2
11481148
ratio = float(project_size.width()) / float(project_size.height())
1149-
width = round(project_size.width() / 2.0) * 2
1150-
height = (round(width / ratio) / 2.0) * 2
1149+
even_width = round(project_size.width() / 2.0) * 2
1150+
even_height = round(round(even_width / ratio) / 2.0) * 2
1151+
project_size = QSize(even_width, even_height)
11511152

1152-
# Emit signal that video widget changed size
1153-
self.win.MaxSizeChanged.emit(project_size)
1153+
# Emit signal that video widget changed size
1154+
self.win.MaxSizeChanged.emit(project_size)
11541155

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

0 commit comments

Comments
 (0)