Skip to content

Commit

Permalink
Fix preview resizing to correctly clear cache, after the call to SetM…
Browse files Browse the repository at this point in the history
…axSize - to prevent small preview window from staying blurry when resized larger
  • Loading branch information
jonoomph committed Mar 27, 2023
1 parent b1af290 commit c73cfdd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/classes/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@ def MaxSizeChangedCB(self, new_size):
log.info('Waiting for main window to initialize before calling SetMaxSize')
time.sleep(0.5)

log.info("Adjusting max size of preview image: %s" % new_size)
# Increase based on DPI
new_size *= self.window.devicePixelRatioF()

# Clear timeline preview cache (since our video size has changed)
self.timeline.ClearAllCache()
log.info("Adjusting max size of preview image: %s" % new_size)

# Set new max video size (Based on preview widget size and display scaling)
scale = self.window.devicePixelRatioF()
self.timeline.SetMaxSize(round(new_size.width() * scale), round(new_size.height() * scale))
self.timeline.SetMaxSize(new_size.width(), new_size.height())

# Clear timeline preview cache (since our video size has changed)
self.timeline.ClearAllCache(True)

# Refresh current frame (since the entire timeline was updated)
self.window.refreshFrameSignal.emit()

0 comments on commit c73cfdd

Please sign in to comment.