All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* GFXMENU: Image scaling
@ 2012-02-22  3:07 Towheed Mohammed
  2012-03-04 23:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Towheed Mohammed @ 2012-02-22  3:07 UTC (permalink / raw
  To: grub-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]

Scaling down an image does not work as intended.  The image only scales down when it's corners touches the respective corner of the screen.

Using a 320x320 image and setting the image component's properties thus:
        + image {
            top = 100%-20
            left = 100%-20
            width = 20
            height = 20
            theme_dir = "/usr/share/grub/themes/demo/images/"
            file = "gnu320.png"
        }

scales the image to 20x20 as expected.  See screenshot: bug-image-scaling-1.png

However, using the same image, and setting the image component's properties thus:
        + image {
            top = 80%
            left = 80%
            width = 20
            height = 20
            theme_dir = "/usr/share/grub/themes/demo/images/"
            file = "gnu320.png"
        }
 
does not scale the image to 20x20.  See screenshot: bug-image-scaling-2.png.  The image is actually scaled to fit the area between 80% and 100% of the screen's dimension.

This shows that the image is not scaled if it's edges does not touch the respective screen boundaries:
        + image {
            top = 0
            left = 368
            width = 20
            height = 20
            theme_dir = "/usr/share/grub/themes/demo/images/"
            file = "gnu320.png"
        }


See screenshot: bug-image-scaling-3.png

If the same image is used as an icon for the menu items, it scales properly.  See screenshot: icon-scaling-1.png

[-- Attachment #2: bug-image-scaling-1.png --]
[-- Type: image/png, Size: 1940 bytes --]

[-- Attachment #3: bug-image-scaling-3.png --]
[-- Type: image/png, Size: 100509 bytes --]

[-- Attachment #4: bug-image-scaling-2.png --]
[-- Type: image/png, Size: 35320 bytes --]

[-- Attachment #5: icon-scaling-1.png --]
[-- Type: image/png, Size: 13032 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GFXMENU: Image scaling
  2012-02-22  3:07 GFXMENU: Image scaling Towheed Mohammed
@ 2012-03-04 23:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-04 23:22 UTC (permalink / raw
  To: grub-devel


>  does not scale the image to 20x20.  See screenshot: bug-image-scaling-2.png.  The image is actually scaled to fit the area between 80% and 100% of the screen's dimension.

It's because image exercises pressure in order to be at least as big as 
source image. We could add a new parameter minimum_width/minimum_height 
but it would be a feature and I doubt it's worth breaking freeze for this


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-04 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22  3:07 GFXMENU: Image scaling Towheed Mohammed
2012-03-04 23:22 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.