After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 302739 - Scaled wallpapers that either "touch inside" or "touch outside"
Scaled wallpapers that either "touch inside" or "touch outside"
Status: RESOLVED DUPLICATE of bug 105231
Product: gnome-control-center
Classification: Core
Component: Background
2.8.x
Other All
: Normal enhancement
: ---
Assigned To: Rodney Dawes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-02 16:44 UTC by Alexander “weej” Jones
Modified: 2005-05-08 17:39 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Alexander “weej” Jones 2005-05-02 16:44:52 UTC
There should be two modes of scaled wallpapers, one that makes the wallpaper
touch the inside of the screen, and one that makes it touch the outside. As it
happens at the moment, if a wallpaper is not the same proportions as your
desktop, you get areas of the screen that are naked.

For example, say you have a desktop of 800×600 and a wallpaper of 1000×800.

Currently, the "scaled" wallpaper mode scales the wallpaper by 600÷800 = 0.75 to
give a size of 750×600, with a 25 pixel gap at the top and bottom. There should
be a different mode of "scaled" which scales it by 800÷1000 = 0.8 to give
800×640, with 20 pixels of the image being invisible on the left and right of
the screen. This makes it nicer to look at if it's a photograph or whatever.

So in summary.

x1, y1 = image dimensions
x2, y2 = screen dimensions
s = scaling factor

if (x1/x2 == y1/y2)
    // The image is of the same proportions as the screen
    s = x2/x1
if (x1/x2 > y1/y2)
    // The width proportionality is greater than the height proportionality
    if (touch outside)
        s = y2/y1
    else
        s = x2/x1
else
    // The width proportionality is less than the height proportionality
    if (touch outside)
        s = x2/x1
    else
        s = y2/y1

This algorithm will give a "touch outside" wallpaper where the entire desktop is
covered, if "touch outside" is true.

I might try and code this myself at some point, because I imagine it to be quite
simple. However, I have never done any patching myself before so don't hold your
breath.

Many thanks

Alex Jones
Comment 1 Rodney Dawes 2005-05-08 17:39:07 UTC

*** This bug has been marked as a duplicate of 105231 ***