KMines background image scaling problem

View: New views
13 Messages — Rating Filter:   Alert me  

KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

KMines doesn't seem to fill the background of the window proper with the background image of the theme. I've scaled the background image of the theme to fit better for wide-screen but I see a white boarder around the image. Any ideas why this is?

Cheers.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Albert Astals Cid-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A Dimarts, 20 d'octubre de 2009, SuseUX@... va escriure:
> Hello.
>
> KMines doesn't seem to fill the background of the window proper with the
> background image of the theme. I've scaled the background image of the
> theme to fit better for wide-screen but I see a white boarder around the
> image. Any ideas why this is?

I think it would be easier if you attach the theme and a screenshot of what
you get.

Albert

>
> Cheers.
>

_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, here's a screenshot. As you can see, the background is not scaling fully to the window and there is a white edge around the background.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/10/20 <SuseUX@...>
Hello.

KMines doesn't seem to fill the background of the window proper with the background image of the theme. I've scaled the background image of the theme to fit better for wide-screen but I see a white boarder around the image. Any ideas why this is?

Cheers.

Sorry, Gmail screwed up, here is the link to the theme with the problem. http://websvn.kde.org/trunk/KDE/kdegames/kmines/themes/graveyard-mayhem.svgz

_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Dmitry Suzdalev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009 03:06:22 Sean wrote:
> Sorry, Gmail screwed up, here is the link to the theme with the problem.
> http://websvn.kde.org/trunk/KDE/kdegames/kmines/themes/graveyard-mayhem.svg
> z
>

Hmm, I checked KMines' code and it doesn't do anything fancy.
What it does is simply renders svg element with name "mainWidget" to the
pixamp which has sizes of the playfield. Btw, that makes me think that
widescreen optimization doesn't make any sense - image will be blindly scaled
in two directions. I guess that's what might be improved in future, but that's
how it works currently.

So what i'm trying to say that this looks like some Qt rendering bug.
Also I don't observe these stripes with any other kmines' themes. Is it so for
you too?

If yes, then try to somehow check if this bug doesn't occur with simple svg
element as a background and then perhaps try to add details step by step to
see where it'll break.

(you're using trunk and Qt 4.6 or some other version?)

Cheers,
Dmitry.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Parent Message unknown Re: KMines background image scaling problem

by Dmitry Suzdalev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009 15:45:33 SuseUX@... wrote:
> The other themes are ok but I think that's because I've scaled my
> background to fit better with wide-screen. Changing the background size in
> the theme seems to make it worse, and the boarder did get worse as I change
> the background image inside the file.
Hmm. I don't get it, how the size of the svg element in .svg file can affect
it when it's rendered? svg is scalable - so I just can resize it to any size.
That's what KMines does.

Or maybe you have a png inside an SVG?

It seems i don't understand something about the situation :)

> As I done the background it looks good scaled at 16:10. If you look at the
> Garden theme background, it look squashed and I wanted to avoid this.
Not sure you can avoid it, this is a limitation/bug in kmines - it simply
doesn't support fixed aspect ratios it will *always* try to stretch the
bakcgound in both directions to try to fill all the widget.

Cheers,
Dmitry.

PS. don't forget to hit "reply All" button so the message would be in k-g-d
too, maybe others will have a hint :)

_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/10/21 Dmitry Suzdalev <dimsuzkde@...>
On Wednesday 21 October 2009 15:45:33 SuseUX@... wrote:
> The other themes are ok but I think that's because I've scaled my
> background to fit better with wide-screen. Changing the background size in
> the theme seems to make it worse, and the boarder did get worse as I change
> the background image inside the file.
Hmm. I don't get it, how the size of the svg element in .svg file can affect
it when it's rendered? svg is scalable - so I just can resize it to any size.
That's what KMines does.

Or maybe you have a png inside an SVG?

It seems i don't understand something about the situation :)

> As I done the background it looks good scaled at 16:10. If you look at the
> Garden theme background, it look squashed and I wanted to avoid this.
Not sure you can avoid it, this is a limitation/bug in kmines - it simply
doesn't support fixed aspect ratios it will *always* try to stretch the
bakcgound in both directions to try to fill all the widget.



No PNG in the background. I set the background back to the default size but I still get the white boarders. :/ 

Here's what it looks like http://imagebin.ca/view/CS1j0B.html


_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Dmitry Suzdalev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009 16:26:33 Sean wrote:
> No PNG in the background. I set the background back to the default size but
> I still get the white boarders. :/
>
> Here's what it looks like http://imagebin.ca/view/CS1j0B.html

Weird. Btw, in trunk i don't have a white borders, i have black ones :)

Looks like this: http://imagebin.ca/view/Vq1PVpz.html

I still can't think of anything other than a Qt bug.

Did you try to incrementally go from very simple background to full featured
version and see at which stage will it break?

I mean for example start with basic background color svg element => see how it
looks in KMines
Then enable some other part of background => check how it looks
etc

If it will work for simpler backgrounds and break on certain step, at least
we'll know if this is Qt or not.

Cheers,
Dmitry.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 21 Oct 2009 13:38, Dmitry Suzdalev <dimsuzkde@...> wrote:

> On Wednesday 21 October 2009 16:26:33 Sean wrote:
>
> > No PNG in the background. I set the background back to the default size but
>
> > I still get the white boarders. :/
>
> >
>
> > Here's what it looks like http://imagebin.ca/view/CS1j0B.html
>
>
>
> Weird. Btw, in trunk i don't have a white borders, i have black ones :)
>
>
>
> Looks like this: http://imagebin.ca/view/Vq1PVpz.html
>
>
>
> I still can't think of anything other than a Qt bug.
>
>
>
> Did you try to incrementally go from very simple background to full featured
>
> version and see at which stage will it break?
>
>
>
> I mean for example start with basic background color svg element => see how it
>
> looks in KMines
>
> Then enable some other part of background => check how it looks
>
> etc
>
>
>
> If it will work for simpler backgrounds and break on certain step, at least
>
> we'll know if this is Qt or not.


OK, I've deleted all of the objects out of the background and it renders without the white boarder(i.e properly). It seems now I've go to find out what object breaks it,
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Dmitry Suzdalev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009 16:55:53 SuseUX@... wrote:
> OK, I've deleted all of the objects out of the background and it renders
> without the white boarder(ie properly). It seems now I've go to find out
> what object breaks it,
Great!

Be sure to write here, so we'll know. Maybe we should report this to trolls,
errr.. nokians :)

Cheers,
Dmitry.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Parker Coates :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 08:55 wrote:
> On 21 Oct 2009 13:38, Dmitry Suzdalev wrote:
>> On Wednesday 21 October 2009 16:26:33 Sean wrote:
> OK, I've deleted all of the objects out of the background and it renders
> without the white boarder(i.e properly). It seems now I've go to find out
> what object breaks it,

Once a long time ago, I had a similar issue (only much worse) when
developing my initial themes for Killbots. In the end it turned out to
be an Inkscape bug.

The group in question looked fine in Inkscape, but in game it only
occupied a small corner of the rectangle given to it. I eventually
resorted to manually walking through the SVG source, until I
eventually found an element inside the group that I couldn't identify.
It turns out it was an invisible rect (I think) that was pushed way
off to the side. For some reason Inkscape ignored it, but QSvgRenderer
did not.

Manually, deleting this element fixed it immediately. I'm not going to
say for certain that you're seeing the same issue, but if the shoe
fits...

Parker
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Dmitry Suzdalev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009 17:08:27 Parker Coates wrote:
> Once a long time ago, I had a similar issue (only much worse) when
> developing my initial themes for Killbots. In the end it turned out to
> be an Inkscape bug.
Ugh. Weird indeed.

Maybe this also can be fixed by trying to open svg in another svg editor and
then saving it? Not sure.

Cheers,
Dmitry.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: KMines background image scaling problem

by Sean-79 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 21 Oct 2009 13:59, Dmitry Suzdalev <dimsuzkde@...> wrote:

> On Wednesday 21 October 2009 16:55:53 SuseUX@... wrote:
>
> > OK, I've deleted all of the objects out of the background and it renders
>
> > without the white boarder(ie properly). It seems now I've go to find out
>
> > what object breaks it,
>
> Great!
>
>
>
> Be sure to write here, so we'll know. Maybe we should report this to trolls,
>
> errr.. nokians :)

I've just tried deleting objects and I'm left with the grass only and it renders the background proper. I removed some objects like the ghosts and it seem to render better, but there are white boarders each side of the background now.
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel