Bug 329312

Summary: Vertical displacement distorts window shadow
Product: [Plasma] Oxygen Reporter: Carlos Vives <mail>
Component: win decoAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: minor CC: hugo.pereira.da.costa
Priority: NOR    
Version: 4.10   
Target Milestone: ---   
Platform: Mageia RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Preset vertical displacement
10px vertical displacement

Description Carlos Vives 2013-12-28 13:20:57 UTC
Increasing vertical displacement for window shadows creates a thin bar below the window, not a window-sized shadow displaced down as expected.

Reproducible: Always

Steps to Reproduce:
1. Increase the vertical displacemente in window deco config to at least 8-10px
2. Shadow is distorted
Actual Results:  
A thin shadow is created below the window.

Expected Results:  
Window-sized shadow, vertically displaced.
Comment 1 Carlos Vives 2013-12-28 13:21:29 UTC
Created attachment 84304 [details]
Preset vertical displacement
Comment 2 Carlos Vives 2013-12-28 13:21:54 UTC
Created attachment 84305 [details]
10px vertical displacement
Comment 3 Hugo Pereira Da Costa 2013-12-28 14:49:00 UTC
yes. Its an artifact of the algorithm used to draw the shadow. There is a maximum limit of the vertical offset before its starts behaving badly.
Now since this limit actually depends on the size of the shadow (the other parameter), it is not easy to limit the corresponding spinbox (not impossible, because one can derive the mathematical formula that link the two, but I have not done yet). Will give it a shot, and limit the offset spinbox to a value that depends on the shadow size.
Comment 4 Hugo Pereira Da Costa 2014-01-31 16:06:46 UTC
Git commit 4d25fd45a829fc31a520e6a39ad9dbb3cab1fa65 by Hugo Pereira Da Costa.
Committed on 31/01/2014 at 16:03.
Pushed by hpereiradacosta into branch 'KDE/4.11'.

Make sure vertical offset does not fall outside of the shadow's inner part, to prevent artifacts.

M  +8    -8    libs/oxygen/oxygenshadowcache.cpp

http://commits.kde.org/kde-workspace/4d25fd45a829fc31a520e6a39ad9dbb3cab1fa65
Comment 5 Hugo Pereira Da Costa 2014-01-31 16:07:26 UTC
Git commit 097786d8bd8500b38001e5ec8d4ce6af3e23c588 by Hugo Pereira Da Costa.
Committed on 31/01/2014 at 16:03.
Pushed by hpereiradacosta into branch 'master'.

Make sure vertical offset does not fall outside of the shadow's inner part, to prevent artifacts.

M  +8    -8    libs/oxygen/oxygenshadowcache.cpp

http://commits.kde.org/kde-workspace/097786d8bd8500b38001e5ec8d4ce6af3e23c588
Comment 6 Hugo Pereira Da Costa 2014-01-31 16:10:23 UTC
That fixes it.
Admittingly this is not perfect since now you will just not see the difference when setting too large offsets, but setting a limit to the max value depending of the actual shadow size is too complicated at the moment.