Gadget resize CHANGED?

BlitzMax Forums/MaxGUI Module/Gadget resize CHANGED?

Taron(Posted 2010) [#1]
I don't even know WHAT has changed, but my old gui code for my synth distorts the window/gadget content now when you resize the window!!!

What is that?

It somehow changes the scaling of everything inside the gadget, but I can't find where or what I have to change to keep it like it used to work?!

Any help is greatly appreciated. <dispair here>


Taron(Posted 2010) [#2]
SetGadgetLayout used to just allow for the gadget's area to change, not for the dimensions of content drawn inside.

Does anyone know what I can do to keep it the way it was?

Thanks in advance!


SebHoll(Posted 2010) [#3]
This is actually a bug in the new DX9Graphics module, in BlitzMax v1.36, and so affects MaxGUI graphics canvases too.

Possible solutions are to either apply the fix Mark posted here or, alternatively, add a call to...

SetGraphicsDriver D3D7Max2DDriver
...or...
SetGraphicsDriver GLMax2DDriver
...at the top of your code.


Taron(Posted 2010) [#4]
Hmmm...doesn't make a difference so far. :{
Neither openGL nor DX7. That's really weird. But it's only in the new compile. The old compile with the old Blitzmax version (1.30) and what ever was the contemporary MaxGui version- still runs fine. Just when I compile with the new versions it can't handle it. Confuses me, too.

DX9 by the way, does even wilder things, antialiasing the whole stretch, too. LOL (not that that's any help, but at least it shows that DX or GL don't seem to have an influence on what happens!?)

You know, I just wonder if I had missed some important change in setting up gadget layouts or how the behave relative to the window or their original size?! Not sure when or if anything had changed in the last year. (I was away from it for a while)


Taron(Posted 2010) [#5]
Remember this code:


This used to work beautifully with the circle staying in center and resizing in the desired way. Now it's totally shot... 8{

THANKS for reacting so quickly, by the way, I didn't mean to forget telling you that. :}


SebHoll(Posted 2010) [#6]
Hmmmmm... Cheers for the code example - I see what you mean.

Try adding:
SetVirtualResolution GadgetWidth(canvas1), GadgetHeight(canvas1)
...immediately after the SetGraphics CanvasGraphics() call in your Redraw() function.

I guess the addition of virtual resolutions to BlitzMax will have broken most people's MaxGUI canvas sizing code. We should perhaps update the docs/examples so that it also includes this call to.

Strange that it hasn't been reported before (that I know of).

DX9 by the way, does even wilder things, antialiasing the whole stretch, too.

Is this with Mark's patch applied?


Taron(Posted 2010) [#7]
Oh, actually, that was before I applied Mark's changes to the mod. I couldn't detect any difference after!

AH THANK GOD! Or rather: Thank YOU!
That works beautifully.... PHEWWWWWW

Yeah, I was already doubting myself there, haha! I had a hunch it was a virtual resolution issue, as that was the only new thing I knew and could think of, hehe.

Sweet!

Thanks again!