Bug 481435 - Annotations made while in Rectangular Region overlay end up in the wrong place
Summary: Annotations made while in Rectangular Region overlay end up in the wrong place
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: git-master
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords: qt6, regression
Depends on:
Blocks:
 
Reported: 2024-02-16 21:01 UTC by Nate Graham
Modified: 2024-04-06 00:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 24.05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2024-02-16 21:01:56 UTC
Today's git master of everything on Plasma 6 Wayland with a single monitor at 225% scale. Scale factor does not seem to make a different, though; I can reproduce it st 200% and 100% scale as well.


STEPS TO REPRODUCE
1. Take a rectangular region in Spectacle using any method (Meta+Shift+Print, "Rectangular region" button in the main UI, etc)
2. Drag a large box
3. Draw any annotation in the left area of the box
4 Hit the enter key to accept the screenshot


OBSERVED RESULT
The annotation is not in the place where I drew it; it is pushed over to the right. If I drew it on the right side of the box, it's missing entirely.
Comment 1 Noah Davis 2024-02-16 21:45:55 UTC
Unfortunately, I cannot reproduce this. I see you put the version as 23.04.1, but that's a mistake, right?
Comment 2 Noah Davis 2024-02-16 21:49:03 UTC
When I tried reproducing this, I tried a few different screen configurations, always with two screens horizontally next to each other.

1. 1x, 2x
2. 1x, 1.75x
3. 1x, 2.25x
4. 1.25x, 2x.

I tried drawing rectangles on both screens and they were always in the correct locations.
Comment 3 Nate Graham 2024-02-16 22:40:07 UTC
That is a mistake, it's current git master.
Comment 4 Nate Graham 2024-02-16 22:58:39 UTC
I just tried it with my dual-screen setup (4k@225% on the left, 1080p@110% on the right) and got the same result. Here's a video that shows it happening, in case my description was not clear enough. I couldn't attach it as I was unable to compress it enough to  get it under the 4 MB size limit on Bugzilla.

https://imgur.com/zr2utzN
Comment 5 Noah Davis 2024-02-16 23:06:22 UTC
Ok, so I did not test actually cropping the rectangle screenshot. The problem occurs when I actually set a rectangular area to capture. Curiously, the problem only applies to the last annotation. Previous annotations are fine and the problem goes away if I undo and redo the last annotation.
Comment 6 Nate Graham 2024-02-16 23:10:49 UTC
Greaṫ! But now I have to wonder: in what universe do you do a Rectangular Region screenshot and not drag a box around something? :D Isn't that the use case of Rectangular Region instead of Full Screen?
Comment 7 Noah Davis 2024-02-17 21:23:04 UTC
(In reply to Nate Graham from comment #6)
> Greaṫ! But now I have to wonder: in what universe do you do a Rectangular
> Region screenshot and not drag a box around something? :D Isn't that the use
> case of Rectangular Region instead of Full Screen?

You can also capture all screens just by pressing enter with no selection.
Comment 8 Noah Davis 2024-04-05 20:20:26 UTC
Git commit f309049a7dab26cfd673bb399480d3ed5825ec9c by Noah Davis.
Committed on 05/04/2024 at 18:55.
Pushed by ndavis into branch 'master'.

Add backend logic for undoable cropping

Also separate mousePath (interactive path) and visualRect from Traits::Geometry into Traits::Interactive and Traits::Visual. Needed to be able to have geometry without visibility or interactivity in a history item.

M  +99   -40   src/Gui/Annotations/AnnotationDocument.cpp
M  +7    -3    src/Gui/Annotations/AnnotationDocument.h
M  +10   -5    src/Gui/Annotations/AnnotationViewport.cpp
M  +6    -5    src/Gui/Annotations/EffectUtils.cpp
M  +143  -29   src/Gui/Annotations/Traits.cpp
M  +41   -13   src/Gui/Annotations/Traits.h

https://invent.kde.org/graphics/spectacle/-/commit/f309049a7dab26cfd673bb399480d3ed5825ec9c