Bug 366538 - Folder plasmoid incorrectly scales elements in action-overlays.svgz
Summary: Folder plasmoid incorrectly scales elements in action-overlays.svgz
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop icons & Folder View widget (show other bugs)
Version: 5.6.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2016-08-09 01:28 UTC by Uri Herrera
Modified: 2018-09-19 14:26 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uri Herrera 2016-08-09 01:28:09 UTC
The plasmoid seems to have problems scaling objects. When an object is i.e. 18px and the object below is 16px the object that is 16px is not scaled properly but when the object is 14px the object is scaled properly. They key difference are those 2 pixels.

These files demonstrate the issue:
1. https://goo.gl/53OFAC <-- action-overlays.svgz
2. https://goo.gl/vVJPcT <-- action-overlays-2.svgz


Reproducible: Always

Steps to Reproduce:
1. Download action-overlays.svgz and add the Folder widget to the desktop.
2. Replace default file in any Plasma theme.
3. Use Kmag to zoom into the widgets' buttons.
4. open-normal is blurred.
5. Download action-overlays-2.svgz
6. Replace file, reload Plasma.
7. open-normal is not blurred. 

Actual Results:  
The svgz file is blurry.

Expected Results:  
The svgz is not blurry.

Both files are pixel perfect, this should not happen. Also, the elements are 24px instead of 22px.
Comment 1 Uri Herrera 2016-08-09 01:29:49 UTC
Also, the elements are 24px instead of 22px.*** Other similar svgz files that have icon-like images are 22px.
Comment 2 Eike Hein 2016-08-09 02:06:49 UTC
Hey, sorry but I don't understand this bug report - please explain the problem again with screenshots. I don't know what objects are being referred to, or when and why they are scaled. If you are referring to the little buttons for selecting or opening a popup, they are just PlasmaCore.SvgItem with width: units.iconSizes.small and no other trickery for sizing or scaling.
Comment 3 Uri Herrera 2016-08-09 03:46:42 UTC
http://i.imgur.com/Tqovfk4.png

Ok, the button uses a 24x24 image. In the screenshot I created an image for it, the green square is 24x24 which is the area that the button uses. Normally this would be transparent. Then I added a yellow square, this square is 18x18. In the screenshot you can see that both squares don't have any jagged edges, that means the pixels are being fully used by the image, this is known as pixel perfect.

Then, I added a red square, this square is 16x16, this square unlike the others for some reason is not being displayed correctly, you can see that it's sort of covering the yellow square below it.

The same happens with the darker cyan square.

But if I remove those two squares:

http://i.imgur.com/4DCWSbE.png

Now the button is fine. All squares are displayed correctly.

http://i.imgur.com/gh2luFK.png

This is the file on Inkscape. On Inkscape each square on its grid is a pixel. The difference in size between each square is 6px; 3x3x3x3.

The blurring only happens when that difference in size is 2px; 1x1x1x1.
Comment 4 Uri Herrera 2016-08-09 03:52:05 UTC
This is how the image used by the button should really look like when zoomed in: http://i.imgur.com/Ip2oiOm.png

You can see that all the squares are aligned to the grid in Inkscape and should be displayed exactly like that. Which is not the case.
Comment 5 Eike Hein 2016-08-09 04:10:08 UTC
Inkscape is not a raster graphics app - it doesn't work with pixels, it works with coordinates. The specific coordinates don't actually matter, only their relative position. This information is then rasterized to a particular size during rendering (which can for example be different depending on DPI scaling). From the screenshots it looks like at particular target sizes rounding causes particular shapes/paths not to line up with the rasterized grid.

It's not something I can control in the code. My suggestion would be to open the SVG in a text editor and check that Inkscape outputted clean coordinate values (i.e. integer values, not numbers with a decimal separaor) that don't cause rounding issues.
Comment 6 Andrew Crouthamel 2018-09-19 14:26:49 UTC
This bug has had its resolution changed, but accidentally has been left in NEEDSINFO status. I am thus closing this bug and setting the status as RESOLVED to reflect the resolution change.