kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #29005
Re: [PATCH] Ruler tool asserts when mirrored text is visible
-
To:
<kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Maciej Suminski <maciej.suminski@xxxxxxx>
-
Date:
Thu, 30 Mar 2017 00:10:39 +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:
<CAG1r56Lg1q=SatZhe5=6hVcPYav_z1GBZdW94ZL7zMMr2DokYw@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,
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
Follow ups
References