kicad-developers team mailing list archive
Mailing list archive
Re: [PATCH] Ruler tool asserts when mirrored text is visible
Kicad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
Maciej Sumiński <maciej.suminski@xxxxxxx>
Fri, 31 Mar 2017 16:17:51 +0200
spf=pass (sender IP is 18.104.22.168) smtp.mailfrom=cern.ch; lists.launchpad.net; dkim=none (message not signed) header.d=none;lists.launchpad.net; dmarc=bestguesspass action=none header.from=cern.ch;
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
It is quite an elegant solution. I have just pushed your patch, thank
you once again.
On 03/30/2017 10:17 AM, John Beard wrote:
> Hi Orson,
> I hit exactly the same thig with the arc assistant, so I made a little
> function: GAL::ResetTextAttributes(), next to GAL::SetTextAttributes(
> This should be sufficient to make it easy to "reset" GAL state when in
> a drawing call that doesn't depend on prior state. Also, if you add a
> text attribute field in future, adding to this function is easy.
> Also provides a handy way to init attributes in GAL::GAL().
> On Thu, Mar 30, 2017 at 6:10 AM, Maciej Suminski
> <maciej.suminski@xxxxxxx> wrote:
>> 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.
>>> On Wed, Mar 29, 2017 at 7:37 PM, John Beard <john.j.beard@xxxxxxxxx> wrote:
>>>> 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
>>>> 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
>>>> 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
>> 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
Description: OpenPGP digital signature