From 3438b03af6408a8ec029625c40cde0215da5c182 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 18 Oct 2023 21:25:41 +0200 Subject: [PATCH] ScreenRecorder: Remember the crop area across recordings of same size If multiple recordings were made in a row, the crop area was reset each time and had to be reselected by users. This change implements the retaining of the cropping area during the lifetime of the Recording dialog, as long as the clip size does not change. A potential trap is now, though, that the cropping area remains the same even if the screen gets changed or the screen recording area was just moved. But I believe that the new convenience outweighs this corner case. Change-Id: I0326dfcad6827b2d504a4e309891824b16b6a47c Reviewed-by: Marcus Tillmanns Reviewed-by: --- src/plugins/screenrecorder/cropandtrim.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index e7b113cc194..c52cc011610 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -783,8 +783,9 @@ CropAndTrimWidget::CropAndTrimWidget(QWidget *parent) void CropAndTrimWidget::setClip(const ClipInfo &clip) { + if (clip.dimensions != m_clipInfo.dimensions) + m_cropRect = {QPoint(), clip.dimensions}; // Reset only if clip size changed m_clipInfo = clip; - m_cropRect = {QPoint(), clip.dimensions}; m_currentFrame = 0; m_trimRange = {m_currentFrame, m_clipInfo.framesCount()}; updateWidgets();