kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #29051
Re: [PATCH] Ruler tool asserts when mirrored text is visible
-
To:
Kicad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Maciej Sumiński <maciej.suminski@xxxxxxx>
-
Date:
Fri, 31 Mar 2017 16:17:51 +0200
-
Authentication-results:
spf=pass (sender IP is 188.184.36.46) 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;
-
In-reply-to:
<CAG1r56KAQbtOZ=Hn23MQDv25HFacuPVYjo60XtOLhgNMb8e02w@mail.gmail.com>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:99
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
Hi John,
It is quite an elegant solution. I have just pushed your patch, thank
you once again.
Cheers,
Orson
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(
> EDA_TEXT*).
>
> 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().
>
> Cheers,
>
> John
>
> On Thu, Mar 30, 2017 at 6:10 AM, Maciej Suminski
> <maciej.suminski@xxxxxxx> wrote:
>> Hi,
>>
>> 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
>> matrix.
>>
>> 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.
>>
>> Cheers,
>> Orson
>>
>> 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
>>
>> _______________________________________________
>> 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
Attachment:
signature.asc
Description: OpenPGP digital signature
References