Bug 425075 - Internal annotations (i. e. not in PDF) are painted in multiply mode, so they look transparent even when “100% opacity” is configured.
Summary: Internal annotations (i. e. not in PDF) are painted in multiply mode, so they...
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.10.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-06 12:48 UTC by Alexander Shchadilov
Modified: 2020-08-08 10:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot fragment - 1600% zoom in Okular (64.42 KB, image/png)
2020-08-06 21:57 UTC, Alexander Shchadilov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Shchadilov 2020-08-06 12:48:53 UTC
SUMMARY
An object "Straight line" used for annotating is always semi-transparent and does not respect "Opacity" setting.

STEPS TO REPRODUCE
1. Open any image file supported by Okular.
2. Press F6 to open "Review" toolbar.
3. Press 5 to activate "Straight line" tool.
4. Make two clicks with LMB on the image view to create a line. 

OBSERVED RESULT
The line is semi-transparent, despite its "Opacity" is 100%.

EXPECTED RESULT
The line is opaque.

SOFTWARE/OS VERSIONS
openSUSE Leap 15.2
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.71.0
Qt Version: 5.12.7
Comment 1 Albert Astals Cid 2020-08-06 21:12:09 UTC
It works fine here. Could you attach an image in which you have such problem?
Comment 2 Alexander Shchadilov 2020-08-06 21:57:57 UTC
Created attachment 130685 [details]
Screenshot fragment - 1600% zoom in Okular
Comment 3 Albert Astals Cid 2020-08-06 22:10:51 UTC
There has ben some misunderstanding, i didn't ask for a screenshot of the problem . I asked for the file you're using to reproduce the problem.
Comment 4 Albert Astals Cid 2020-08-06 22:12:38 UTC
Ah, interesting i can reproduce it now, if the line is black it works fine, so the line needs to be of a different color
Comment 5 Laura David Hurka 2020-08-06 22:22:04 UTC
I indeed wondered about this code. The PagePainter::draw...() methods, which are responsible for drawing internal annotations, are always called with composition mode “multiply”. They are indeed 100% opaque, but “multiply” is not what you are used to see.

The problem with this is that they become completely invisible e. g. when “Invert colors” is activated on a .txt document, or the document is otherwise just dark.

The correct composition modes would be: “soft light” for Highlighter annotations and simply “normal” for all other annotations. “Soft light” has potentially bad performance, so another option would be to choose “multiply” or “screen” depending on the document and color mode.

I assume “multiply” just evolved from a time when only Highlighter annotations and documents with light background were relevant. Future developers probably just wondered about it and adopted it, because they thought it must have some reason.
Comment 6 Alexander Shchadilov 2020-08-07 09:06:17 UTC
Astals Cid from comment #4)
> line needs to be of a different color

I noticed this with default colour of my version, #ffe000. Now I see that with white it becomes invisible.
Also reproducible with:
- Polygon
Not reproducible with:
- Freehand line
- Geometry (Ellipse tool creates this)
Comment 7 Albert Astals Cid 2020-08-07 22:13:11 UTC
Git commit c171e5aecc1a38ed22c0c07a56b17eddc90ef67e by Albert Astals Cid.
Committed on 06/08/2020 at 22:35.
Pushed by aacid into branch 'master'.

PagePainter: Don't draw Arrow/Line annotations with multipyl

Otherwise they will be transparent when they shouldn't

M  +9    -9    ui/pagepainter.cpp
M  +1    -1    ui/pagepainter.h

https://invent.kde.org/graphics/okular/commit/c171e5aecc1a38ed22c0c07a56b17eddc90ef67e
Comment 8 Albert Astals Cid 2020-08-08 00:20:21 UTC
Git commit 389c7b0235fe762cda799ad4ce8bfbe710bef210 by Albert Astals Cid.
Committed on 07/08/2020 at 22:33.
Pushed by aacid into branch 'release/20.08'.

PagePainter: Don't draw Arrow/Line annotations with multipyl

Otherwise they will be transparent when they shouldn't

M  +9    -9    ui/pagepainter.cpp
M  +1    -1    ui/pagepainter.h

https://invent.kde.org/graphics/okular/commit/389c7b0235fe762cda799ad4ce8bfbe710bef210
Comment 9 Albert Astals Cid 2020-08-08 10:49:57 UTC
Git commit 3a331b782e14ffe0c24ffd324899312e27306790 by Albert Astals Cid.
Committed on 07/08/2020 at 22:32.
Pushed by aacid into branch 'master'.

PagePainter: Don't draw Arrow/Line annotations with multipyl

Otherwise they will be transparent when they shouldn't

M  +9    -9    ui/pagepainter.cpp
M  +1    -1    ui/pagepainter.h

https://invent.kde.org/graphics/okular/commit/3a331b782e14ffe0c24ffd324899312e27306790