Revert gl.Text
Moderator: Moderators
Revert gl.Text
In .80.2 gl.Text got 'accidentally' changed by jK and he refuses to revert the change, this changes fucks up all widgets that use gl.Text.
The change is this: http://springrts.com/wiki/GetTextHeight
It makes no sense as default behavior.
The change is this: http://springrts.com/wiki/GetTextHeight
It makes no sense as default behavior.
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: Revert gl.Text
Was this something that could have been made easily backwards compatible?
Cause I agree with the above if so.
Cause I agree with the above if so.
Re: Revert gl.Text
He could have just added another flag for this new behavior, and keep default as it was. So yes.
Re: Revert gl.Text
It broke all widgets that use gl.Text, it should be reverted. And you yourself said it's an accident.jK wrote:Accidental the default text alignment has changed, before it was descender now it's baseline. Somehow I prefer it this way, so I am hold off to revert it. The only problem I see is that lua doesn't have an opcode for the old behaviour, cuz the functions is running out of chars (b=bottom, d=baseline, ???=descender).
Use a new flag for new behavior, backwards compatibility anyone?
Re: Revert gl.Text
There already is a flag for it, and a claim that he could have made it optional when it was an accident is dubious.
Re: Revert gl.Text
Something that breaks every widget using gl.Text should be made optional and not default.lurker wrote:There already is a flag for it, and a claim that he could have made it optional when it was an accident is dubious.
Re: Revert gl.Text
The question isn't how many widgets it breaks, it is whether or not it is correct.
I don't disagree with the change but can recognize the issues caused by it.
I don't disagree with the change but can recognize the issues caused by it.
Re: Revert gl.Text
There are no standards for spring, so this change is neither correct nor wrong in that perspective, but this change is purely a matter of preference of one person, and it breaks a lot of widgets. That does make it not correct.smoth wrote:The question isn't how many widgets it breaks, it is whether or not it is correct.
Re: Revert gl.Text
Old y offset, or new one, it is just a convention. I never saw anything "broken" or "buggy" in the old behavior. I fail to see what the new behavior fix. Whether the text is aligned to descender or baseline, none is more "correct" than the other, it's just a matter of picking one and sticking to it.
However, now that you changed the convention, there's hundreds of widgets widgets that needs to be modified. I cannot even say "fixed" or "updated", because there was nothing broken or outdated in the old behavior.
However, now that you changed the convention, there's hundreds of widgets widgets that needs to be modified. I cannot even say "fixed" or "updated", because there was nothing broken or outdated in the old behavior.
Just because of one guy preference, all widget that draw text are now broken. We weren't even warned about that changed. I noticed it as soon as it appeared, between 80.0 and 80.1, devs didn't deign answering me (but surely automatically uploading megabytes of infolog to mantis would have help, AF?). All widgets have to be updated, all mods have to be updated, including those whose who can't because maintener left or that have spread everywhere.jK wrote:Somehow I prefer it this way, so I am hold off to revert it.
Well, there is the de-facto standard which is: what we've been using for years.Regret wrote:There are no standards for spring
Re: Revert gl.Text
The widgets it breaks arguably already have plenty of bugs, such as not disapearing when f5 is pressed.
Re: Revert gl.Text
No they don't. This breaks literally every widget that draws text, and not every is bugged.AF wrote:The widgets it breaks arguably already have plenty of bugs, such as not disapearing when f5 is pressed.
Also as of certain spring version all widgets are properly hidden after f5 is pressed because drawscreen call gets disabled when UI is disabled.
Re: Revert gl.Text
In one widget, and in one gadget, out of any function, but in unsynced for the gadget, I use:
This way, I revert to old behavior by editing only two files instead of god know how many. The +size/4 is not the exact offset to revert to old position, but good enough for me. Doing that probably add alot of issues, such as messing with mod-external widget, applying the offset more than once when the widget is toggled couple time ingame, and jK will probably tell me that I understood nothing and am doing it all wrong.
Code: Select all
-- Fix gl.Text y offset that changed between 0.80.0 and 0.80.1
if tonumber(string.sub(Game.version,1,3) or 0)>=0.80 and tonumber(string.sub(Game.version,6,6) or 0)>=1 then
local glText = gl.Text
gl.Text = function(text,x,y,size,options)
if size then
glText(text,x,y+size/4,size,options)
else
glText(text,x,y,size,options)
end
end
end
Re: Revert gl.Text
It needs to be reverted, and it needs to be reverted for the next release, which needs to be quick. Otehrwise half the code out there will be modified for the change, and half won't, and then it will probably eventually get changed back in the far future and mess everything up again.
Re: Revert gl.Text
Those issues are why I suggested to put it in the widget handler, if your game includes one. Definitely put it in draw.lua for gadgets.
Re: Revert gl.Text
Lurker, people use widgets outside of the ones included in mods... what you're saying isn't relevant to the majority of people.
Exactly what he said. Either announce that this isn't getting reverted, and mention that you feel the holocaust was a hoax for good measure, or announce that it will be reverted quickly. Whatever the decision, just do it fast. Otherwise it's going to be a clusterfail.FLOZi wrote:It needs to be reverted, and it needs to be reverted for the next release, which needs to be quick. Otehrwise half the code out there will be modified for the change, and half won't, and then it will probably eventually get changed back in the far future and mess everything up again.
Last edited by Caydr on 23 Aug 2009, 02:11, edited 1 time in total.
Re: Revert gl.Text
Caydr, zwzsg's function as is has an extremely high chance of conflict if you put it in a standalone widget, and doesn't belong in any of them. What you're saying isn't relevant to the majority of people.
Re: Revert gl.Text
Sorry, I thought you were replying to flozi.
Re: Revert gl.Text
K. Also, I'll have a little thing to make it able to go in any and all widgets without conflict 2 minutes after dinner.
Re: Revert gl.Text
Irrelevant. Are you going to update every widget that uses gl.Text? No.lurker wrote:K. Also, I'll have a little thing to make it able to go in any and all widgets without conflict 2 minutes after dinner.
Revert it.