I modified the HelloDraw routine in the SDK_C\HELLO sample to show this
fault.
Can anyone find fault with the routine?
Can anyone confirm this is a Geos Library bug?
void
HelloDraw(GStateHandle gstate) /* GState to draw to */
{
/* These constants are used in the code below: */
#define TEXT_POINT_SIZE 18.0 /* point size */
#define TEXT_ROTATION -15 /* angle of rotation (degrees) */
#define TEXT_X_POSITION 30 /* x position, in document coords
*/
#define TEXT_Y_POSITION 0 /* y position, in document coords
*/
int i = 0;
dword degree;
/*
* First change some of the default GState values, such as font
*/
GrSetFont(gstate, FID_DTC_URW_SANS, MakeWWFixed(TEXT_POINT_SIZE));
/*
* Set the text color to something nice (Light Blue is Nice, by
definition)
*/
GrSetTextColor(gstate, CF_INDEX, C_LIGHT_BLUE, 0, 0);
GrApplyTranslation(gstate, MakeWWFixed(150), MakeWWFixed(150));
/* We want to start text at the left */
GrApplyRotation(gstate, MakeWWFixed(90));
/* And justify from the center, so we rotate half the 150 degree span */
GrApplyRotation(gstate, MakeWWFixed(75));
do {
degree = i * 15; /* play with this number and really screw up the screen
*/
degree *= 65536;
/* We want text to go clockwise */
degree *= (-1);
/* Save the transform because we are going to start from the center,
* rotate the drawing space, move out from the center 70 points,
* then rotate the drawing space back to the same direction as the
starting
* point. (The starting point is where text is centered and does not
include
* the original 90 degree rotation to get to the staring point) */
GrSaveTransform(gstate);
GrApplyRotation(gstate, degree);
GrApplyTranslation(gstate, 0, MakeWWFixed(-70));
degree += MakeWWFixed(75);
GrApplyRotation(gstate, degree * (-1));
GrDrawChar(gstate, 0, 0, 65 + i);
/* Restore the transforn to get back to the starting point */
GrRestoreTransform(gstate);
i++;
} while (i < 11);
}