Opened 6 years ago

Closed 5 years ago

#11644 closed bug (fixed)

[Screenshot] aspect ratio is not always correct

Reported by: diver Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Screenshot Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All



Screenshot doesn't respect aspect ratio in certain cases making preview look bad and stretched.

Attachments (2)

0001-Fix-11644.patch (1.6 KB ) - added by TwoFx 5 years ago.
Proposed patch
0001-Screenshot-Correctly-show-normal-sized-preview-after.patch (1.4 KB ) - added by TwoFx 5 years ago.
Fix for the fix

Download all attachments as: .zip

Change History (7)

by TwoFx, 5 years ago

Attachment: 0001-Fix-11644.patch added

Proposed patch

comment:1 by TwoFx, 5 years ago

patch: 01

comment:2 by TwoFx, 5 years ago

I have attached a patch that fixes the issue. The problem was that for some reason, the height of the preview panel was always assumed to be 150 pixels, which is of course wrong, since it actually depends on what the BLayoutBuilder suggests. Instead, the height is now always preserved, and the width of the preview is calculated based on that. Additionally, only SetPreferredMinSize was set, which was usually smaller than the size that was set by the layout, resulting in the aspect ration calculations actually having no effect at all. I added a call to SetExplicitMaxSize so that the size is always set, however I assume there is a more idiomatic way of setting the exact size of the preview. The call to this->Layout() is necessary to initially set the size of the preview window so it knows what height to keep when _UpdatePreviewPanel is called (otherwise it is 0 when the method is first called).

comment:3 by waddlesplash, 5 years ago

Resolution: fixed
Status: newclosed

Applied in hrev49457. Thanks!

comment:4 by TwoFx, 5 years ago

Resolution: fixed
Status: closedreopened

The fix was not 100% correct, the apect ratio was maintained, but when previewing a very large window and then switching back to previewing the whole screen, the preview was unnecessarily small. I attached another patch to fix the fix, so to speak.

comment:5 by waddlesplash, 5 years ago

Resolution: fixed
Status: reopenedclosed

Applied in hrev49468.

Note: See TracTickets for help on using tickets.