Skip to content

Commit

Permalink
Fix viewport zooming & region selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Jan 2, 2022
1 parent 878e4ff commit a9c1f10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/windows/video_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ def centeredViewport(self, width, height):
window_rect = QRectF(QPointF(0, 0), window_size)

aspectRatio = self.aspect_ratio.ToFloat() * self.pixel_ratio.ToFloat()
viewport_size = QSizeF(aspectRatio, 1).scaled(window_size, Qt.KeepAspectRatio)
viewport_size = QSizeF(aspectRatio, 1).scaled(
window_size, Qt.KeepAspectRatio
) * self.zoom
viewport_rect = QRectF(QPointF(0, 0), viewport_size)
viewport_rect.moveCenter(window_rect.center())

Expand Down Expand Up @@ -1266,7 +1268,7 @@ def keyFrameTransformTriggered(self, effect_id, clip_id):
def regionTriggered(self, clip_id):
"""Handle the 'select region' signal when it's emitted"""
# Clear transform
self.region_enabled = bool(not clip_id)
self.region_enabled = bool(clip_id)
get_app().window.refreshFrameSignal.emit()

def resizeEvent(self, event):
Expand Down

0 comments on commit a9c1f10

Please sign in to comment.