Re: aaditya - r31467

Martin Sevior <[email protected]>
Newsgroups gmane.editors.abiword.devel
Message-ID <CAOJESBUnyj2X9w=D8=V9bpyh1Wrck1bWNDBM+=GzpvS-H-6imw@mail.gmail.com>
Thanks Aaditya!

Cheers

Martin


On Sat, Jul 7, 2012 at 4:01 PM, Aaditya Chauhan
<[email protected]> wrote:
> Hi Martin,
>
> The code you have written, sets the angle, da.pG->setTextAngle(iA); before
> drawing the LINE_CONTAINER by passing the arguments : pContainer-draw(&da);
> and then again sets it back to zero, after drawing the frame :
> da.pG->setTextAngle(0.0);
>
> While my code :-
>
> +                       pContainer->draw(&da);
> +                       if(pContainer -> getContainerType() ==
> FP_CONTAINER_LINE)
> +                       pG->setTextAngle(iA);
> +                       else
> +                       pG->setTextAngle(0.0);
>
> first draws the container by pContainer->draw(&da); and then sets the angle,
> instead of the other way around. So it would at-best only set the angle for
> last frame container ( if any ).
> Also I used pG->setTextAngle(); where pG is a pointer to graphics class
> instead of using da.pG which is a structure element.
>
> Sorry for the Mistake, I would be more careful in the future. I will
> re-commit the changes after rectifying the mistake.
>
> Regards,
>
> Aaditya Chauhan
>
>
> On Fri, Jul 6, 2012 at 7:40 AM, Martin Sevior <[email protected]> wrote:
>>
>>
>> Hi Aaditya,
>>
>> Your code should be this:
>>
>> if(pContainer -> getContainerType() == FP_CONTAINER_LINE)
>> {
>>     da.pG->setTextAngle(iA);
>>     pContainer-draw(&da);
>>     da.pG->setTextAngle(0.0);
>> }
>>
>> Now you have to explain to me why the code I've just written is
>> correct and what is wrong with yours.
>>
>> (Sorry it's the Professor in me :-)
>>
>> Cheers
>>
>> Martin
>>
>> +                       pContainer->draw(&da);
>> +                       if(pContainer -> getContainerType() ==
>> FP_CONTAINER_LINE)
>> +                       pG->setTextAngle(iA);
>> +                       else
>> +                       pG->setTextAngle(0.0);
>
>
>
>
> --
> Aaditya Chauhan
> Electronics and Communication
> NSIT - New Delhi
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.