Skip to content

Commit c73cfdd

Browse files
committed
Fix preview resizing to correctly clear cache, after the call to SetMaxSize - to prevent small preview window from staying blurry when resized larger
1 parent b1af290 commit c73cfdd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/classes/timeline.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ def MaxSizeChangedCB(self, new_size):
120120
log.info('Waiting for main window to initialize before calling SetMaxSize')
121121
time.sleep(0.5)
122122

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

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

128128
# Set new max video size (Based on preview widget size and display scaling)
129-
scale = self.window.devicePixelRatioF()
130-
self.timeline.SetMaxSize(round(new_size.width() * scale), round(new_size.height() * scale))
129+
self.timeline.SetMaxSize(new_size.width(), new_size.height())
130+
131+
# Clear timeline preview cache (since our video size has changed)
132+
self.timeline.ClearAllCache(True)
131133

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

0 commit comments

Comments
 (0)