These functions were not added to the list of Fl_Graphics_Driver
member functions because they just call fl_mult_matrix()
that is a member function.
Thus, it is possible to use several transformation matrices in parallel
with these functions, because fl_mult_matrix() applies the
scaling, translation or rotation to the current graphics device.
> /**
> Concatenates scaling transformation onto the current one.
> \param[in] x,y scale factors in x-direction and y-direction
> */
> void fl_scale(double x,double y) {fl_mult_matrix(x,0,0,y,0,0);}
>
> /**
> Concatenates scaling transformation onto the current one.
> \param[in] x scale factor in both x-direction and y-direction
> */
> void fl_scale(double x) {fl_mult_matrix(x,0,0,x,0,0);}
>
> /**
> Concatenates translation transformation onto the current one.
> \param[in] x,y translation factor in x-direction and y-direction
> */
> void fl_translate(double x,double y) {fl_mult_matrix(1,0,0,1,x,y);}
>
> /**
> Concatenates rotation transformation onto the current one.
> \param[in] d - rotation angle, counter-clockwise in degrees (not radians)
> */
> void fl_rotate(double d) {
> if (d) {
> double s, c;
> if (d == 0) {s = 0; c = 1;}
> else if (d == 90) {s = 1; c = 0;}
> else if (d == 180) {s = 0; c = -1;}
> else if (d == 270 || d == -90) {s = -1; c = 0;}
> else {s = sin(d*M_PI/180); c = cos(d*M_PI/180);}
> fl_mult_matrix(c,-s,s,c,0,0);
> }
> }
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev