Bug 488025

Summary: Highlighter tool draws solid color instead of highlighting
Product: [Applications] Spectacle Reporter: cwo <cwo.kde>
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate
Priority: NOR    
Version: 24.04.80   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 24.05.1
Sentry Crash Report:

Description cwo 2024-06-04 16:27:13 UTC
SUMMARY

In 23.08.05 on Kubuntu 24.04, the highlighter tool works as expected: changing the color from how it was before, but leaving enough of the original visible, similar to how a highlighter would work on paper.

In 24.04.70 on KDE neon developer edition (the precise version is not available in the version selection above, so I chose the closest), this no longer works: the tool now draws solid color and does not leave anything of the original visible. 

STEPS TO REPRODUCE
1. Open Spectacle while the screen contains a window with black text on a white background
2. Click edit in the toolbar, and select the highlighter tool
3. Pick a word, click-and-hold at its beginning and move the pointer to the end of the word before releasing

OBSERVED RESULT

The selected word (or at least parts of it) is no longer visible, replaced by a line of solid color matching the color selected for the highlighter tool. 

EXPECTED RESULT

The word is still visible, only the white background has changed to a background matching the highlighter color.

SOFTWARE/OS VERSIONS

I have confirmed this in current Neon developer edition, running Wayland, with Spectacle 24.04.70. It does not apply with Spctacle 23.08.05 in Kubuntu 24.04 using Wayland or Xorg. /u/Hojita2k who originally reported this on reddit (https://redd.it/8h92nf) says the wrong behavior also applies in 24.05, but I have not independently verified this.

Linux/KDE Plasma: 6.5.0-35generic (64 bit)
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.0
Comment 1 Noah Davis 2024-06-05 17:05:53 UTC
Oof, looks like a major optimization that was made months before the release of 24.05 caused this.
Comment 2 Bug Janitor Service 2024-06-05 17:22:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/374
Comment 3 Noah Davis 2024-06-05 18:38:41 UTC
Git commit dd2231b5b33cc8d124b68eeeacee19f20cc009b1 by Noah Davis.
Committed on 05/06/2024 at 17:23.
Pushed by ndavis into branch 'master'.

AnnotationDocument: Fix highlighter tool not blending with base image

Previously, the graphics were split into a base image and an annotations image. The change helped to improve CPU performance by not repainting the base image so much, but it messed up the highlighter effect. The highlighter needs to be blended with the base image in order to work correctly.

Now the base image is blended into the annotations image in places where the highlighter is used. This will probably hurt performance somewhat, but it doesn't seem too bad so far.

M  +30   -1    src/Gui/Annotations/AnnotationDocument.cpp

https://invent.kde.org/graphics/spectacle/-/commit/dd2231b5b33cc8d124b68eeeacee19f20cc009b1
Comment 4 Noah Davis 2024-06-05 18:40:45 UTC
Git commit 0c215c788e38b39b1126af14ab0c6b3187f15711 by Noah Davis.
Committed on 05/06/2024 at 18:39.
Pushed by ndavis into branch 'release/24.05'.

AnnotationDocument: Fix highlighter tool not blending with base image

Previously, the graphics were split into a base image and an annotations image. The change helped to improve CPU performance by not repainting the base image so much, but it messed up the highlighter effect. The highlighter needs to be blended with the base image in order to work correctly.

Now the base image is blended into the annotations image in places where the highlighter is used. This will probably hurt performance somewhat, but it doesn't seem too bad so far.

(cherry picked from commit dd2231b5b33cc8d124b68eeeacee19f20cc009b1)

Co-authored-by: Noah Davis <noahadvs@gmail.com>

M  +30   -1    src/Gui/Annotations/AnnotationDocument.cpp

https://invent.kde.org/graphics/spectacle/-/commit/0c215c788e38b39b1126af14ab0c6b3187f15711