Hi Aaditya,
In addition since the text angle is a property of the frame, every line in the frame must be rotated. There is no need to set the text angle back to 0.0 after drawing each line. You only need to do that have you've finished drawing all the lines in the text box.ie At the end of the loop. Please correct your logic so that:
1. Only frames with a non-zero text angle change the angle of text rotation in the graphics class.
2. Only lines within a frame set the rotation angle.
3. Keep the number of changes to the text rotation angle to a minimum.
4. Make sure that if the text rotation angle has been changed, it is changed back after all the containers in the text box (frame) are drawn.
Now you will also need to create a need method in the GR_Graphics class that actually changes the rotation angle in the cairo context. (You did this via some hard-coded early in your project. You simply have to make sure this
gets called whenever the text angle m_rTextAngle is changed in gr_Graphics. You can do this within the
GR_Graphics::setTextAngle(double angle) method.
Martin
________________________________________
From: owner-abiword-dev@abisource.com [owner-abiword-dev@abisource.com] on behalf of Martin Edmund Sevior [martines@unimelb.edu.au]
Sent: Wednesday, July 11, 2012 7:30 AM
To: abiword-dev@abisource.com; abisource-cvs-commit@abisource.com
Subject: RE: aaditya - r31489 - abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp
Hi Aaditya,
You should code with the style conventions of the rest of abiword. You "if" statement below should be like this:
if(pContainer -> getContainerType() == FP_CONTAINER_LINE)
{
pG->setTextAngle(iA);
}
else
{
pG->setTextAngle(0.0);
}
Now the next thing you have to do is to only change the text angle if iA is non-zero and actually set it before you call pContainer->draw(&da); Further more you should pG within the da struct.
da.pG->setTextAngle(0.0)
This is what we discussed a few days ago. Your code as committed has no chance of working.
Martin
________________________________________
From: owner-abisource-cvs-commit@abisource.com [owner-abisource-cvs-commit@abisource.com] on behalf of cvs@abisource.com [cvs@abisource.com]
Sent: Wednesday, July 11, 2012 5:16 AM
To: abisource-cvs-commit@abisource.com
Subject: aaditya - r31489 - abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp
Author: aaditya
Date: 2012-07-10 21:16:17 +0200 (Tue, 10 Jul 2012)
New Revision: 31489
Modified:
abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp/fp_FrameContainer.cpp
Log:
Making Corrections to the Frame Code, and adding the Debug message to draw(), as told be Martin
Modified: abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp/fp_FrameContainer.cpp
===================================================================
--- abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp/fp_FrameContainer.cpp 2012-07-10 18:56:00 UTC (rev 31488)
+++ abiword/branches/gsoc2012_rotated_text/src/text/fmt/xp/fp_FrameContainer.cpp 2012-07-10 19:16:17 UTC (rev 31489)
@@ -695,7 +695,6 @@
const UT_Rect * pPrevRect = pDA->pG->getClipRect();
UT_Rect * pRect = getScreenRect();
UT_Rect newRect;
- fp_Container *pContainer = NULL;
bool bRemoveRectAfter = false;
bool bSetOrigClip = false;
bool bSkip = false;
@@ -735,11 +734,16 @@
fp_ContainerObject* pContainer = static_cast<fp_ContainerObject*>(getNthCon(i));
da.xoff = pDA->xoff + pContainer->getX();
da.yoff = pDA->yoff + pContainer->getY();
- pContainer->draw(&da);
if(pContainer -> getContainerType() == FP_CONTAINER_LINE)
- pG->setTextAngle(iA);
+ {
+ UT_DEBUGMSG(("Angle Set for frame containers %f\n",getRotationAngle()));
+ da.pG->setTextAngle(iA);
+ pContainer->draw(&da);
+ da.pG->setTextAngle(0.0);
+ }
else
- pG->setTextAngle(0.0);
+ pContainer->draw(&da);
+
}
}
m_bNeverDrawn = false;
-----------------------------------------------
To unsubscribe from this list, send a message to
abisource-cvs-commit-request@abisource.com with the word
unsubscribe in the message body.
Received on Wed Jul 11 00:01:11 2012
This archive was generated by hypermail 2.1.8 : Wed Jul 11 2012 - 00:01:11 CEST