Re: aaditya - r31467

Aaditya Chauhan <[email protected]>
Newsgroups gmane.editors.abiword.devel
Message-ID <CAHAUm_ahP_1y5O7L2EfKCa=_TYCN0fyW9Va4Pjjr=PBDcO-okQ@mail.gmail.com>
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 7/6/12, 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.