Tilix: Bg: scaled, keeping ratio

Created on 23 May 2016  路  8Comments  路  Source: gnunn1/tilix

Thanks for the background image support, it's really awesome!

Along with Scale/Tile/Center, I believe a great choice would be to crop along one axis only (centered) and scale keeping the aspect ratio.

(I guess this is what most phones/desktops do with background image.)

E.g. if the canvas is 500x300 and the picture is 1000x800 then it'd be scaled down to 500x400 and then the top and bottom 50+50px cropped.

enhancement

Most helpful comment

lol, with all the time spent on this background image feature I probably could have solved world hunger instead! Good thing it's been a fun feature to implement and it's been interesting learning more about Cairo.

Anyway, I'll have a look at this.

All 8 comments

Just wondering about the terminology to use... maybe Scale for this one, and rename the current Scale to Stretch?

Or remove the existing scale completely? Is this really useful?

For the current Scale option, I'm vacillating between calling it Stretch or Fill.

@phw It's a fair point, some people though may like it from the point of view of having the terminal window completely filled.

FYI:

What I had in mind was to crop the image, so that whatever remains fills in the whole application window.

Displaying the entire picture, plus empty margins if necessary, is another viable option, but I like it less :)

Also, due to the (per-terminal) title bar, it _seems_ that the picture is not vertically centered. This is a bit distracting with margins, but probably far less noticeable if the image is cropped.

Thanks!

I missed the cropping part, I'l see what I can do.

It now crops from the left or from the top, rather than equally from both opposite sides (either from top and bottom, or from left and right). Probably a div by 2 missing. Just sayin :P

lol, with all the time spent on this background image feature I probably could have solved world hunger instead! Good thing it's been a fun feature to implement and it's been interesting learning more about Cairo.

Anyway, I'll have a look at this.

Not sure about you guys, but I like it a lot! Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alalfakawma picture alalfakawma  路  4Comments

yodatak picture yodatak  路  4Comments

sirex picture sirex  路  3Comments

gregflynn picture gregflynn  路  4Comments

zsrinivas picture zsrinivas  路  4Comments