← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Ruler tool asserts when mirrored text is visible



Thank you John, I have just committed your patch.

There are basic Save()/Restore() functions, but IIRC they do not store
the font settings, but are mostly used to maintain the transformation

I am not sure about the best solution here. None of the drawing
functions make any assumptions about the used drawing settings (color,
line width, stroke/fill, etc.), so perhaps this should be the same for
texts. Alternatively there could be a Reset() function, but anyway you
are likely to set the text line width and size, so effectively you would
just restore the attributes. I am open to discuss other ideas.


On 03/29/2017 01:40 PM, John Beard wrote:
> Sorry, that patch doesn't have the right comment. Please use this one.
> Thanks,
> John
> On Wed, Mar 29, 2017 at 7:37 PM, John Beard <john.j.beard@xxxxxxxxx> wrote:
>> Hi,
>> This resolves https://bugs.launchpad.net/kicad/+bug/1677210.
>> This is caused because the GAL ruler tool didn't reset its text
>> mirroring flag before drawing bitmap text. This means if the GAL had
>> just drawn mirrored text, it would be set, but this is invalid for
>> OpenGL bitmap fonts (and if it were, would still be incorrect).
>> I also reset bold/italic, though bitmaps text doesn't seem to care
>> about that at all.
>> This fixes the bug. In the longer run, this is still not really ideal,
>> as every draw-er on the GAL seems to need to reset every single
>> parametert that it might need. If a parameter is added, all these
>> "reset loci" need to be vetted for possibly adding or resetting that
>> parameter.
>> Would some kind of stack mechanism make sense here? Unrelated
>> functions probably should start from a blank slate of some sort. Maybe
>> a way to avoid unnecessary stack shuffling if you /know/ you don't
>> need to reset GAL parameters and it's a performance hit to do so
>> needlessly?
>> Cheers,
>> John
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp

Follow ups