From: <hba...@us...> - 2007-08-16 02:05:09
|
Revision: 7804 http://plplot.svn.sourceforge.net/plplot/?rev=7804&view=rev Author: hbabcock Date: 2007-08-15 19:05:11 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Added support for portrait mode to the pscairo driver. Plot orientations and aspect ratios follow that of the ps driver. Modified Paths: -------------- trunk/drivers/cairo.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2007-08-15 23:02:28 UTC (rev 7803) +++ trunk/drivers/cairo.c 2007-08-16 02:05:11 UTC (rev 7804) @@ -1023,11 +1023,13 @@ // Save the pointer to the structure in the PLplot stream pls->dev = aStream; - // Rotate the surface to landscape. - rotate_cairo_surface(pls, 0.0, -1.0, -1.0, 0.0, pls->ylength, pls->xlength); + // Handle portrait or landscape + if(pls->portrait){ + rotate_cairo_surface(pls, (float)(pls->ylength)/(float)(pls->xlength), 0.0, 0.0, -(float)(pls->xlength)/(float)(pls->ylength), 0.0, pls->xlength); + } else { + rotate_cairo_surface(pls, 0.0, -1.0, -1.0, 0.0, pls->ylength, pls->xlength); + } - // Invert the surface so that the graphs are drawn right side up. - // rotate_cairo_surface(pls, 1.0, 0.0, 0.0, -1.0, 0, pls->ylength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |