[rkward-cvs] SF.net SVN: rkward: [1464] trunk/rkward/rkward/plugins/x11device

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Sat Feb 24 01:17:01 UTC 2007


Revision: 1464
          http://svn.sourceforge.net/rkward/?rev=1464&view=rev
Author:   kapatp
Date:     2007-02-23 17:17:01 -0800 (Fri, 23 Feb 2007)

Log Message:
-----------
Export (new) update: <browser type=savefile> and round(width and height) for png/jpeg

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/x11device/export_new.php
    trunk/rkward/rkward/plugins/x11device/export_new.xml

Modified: trunk/rkward/rkward/plugins/x11device/export_new.php
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export_new.php	2007-02-23 21:38:46 UTC (rev 1463)
+++ trunk/rkward/rkward/plugins/x11device/export_new.php	2007-02-24 01:17:01 UTC (rev 1464)
@@ -34,9 +34,12 @@
 	// jpeg()/png() need at least one of width/height. For jpeg()/png() the width/height parameter (in pixels)
 	// is calculated using width/height (in inches) times the resolution. For postscript()/pdf() $resolution is set to 1.
 	if ($jpegpng && $autoW && $autoH) $options .= ", width=par(\"din\")[1]*" . $resolution;
-	else {
-		if(!$autoW) $options .= ", width=" . getRK_val ("width")*$resolution;
-		if(!$autoH) $options .= ", height=" . getRK_val ("height")*$resolution;
+	elseif ($jpegpng) {
+		if(!$autoW) $options .= ", width=" . round(getRK_val ("width")*$resolution);
+		if(!$autoH) $options .= ", height=" . round(getRK_val ("height")*$resolution);
+	}	else {
+		if(!$autoW) $options .= ", width=" . getRK_val ("width");
+		if(!$autoH) $options .= ", height=" . getRK_val ("height");
 	}
 
 	// pointsize, resolution and quality parameters:

Modified: trunk/rkward/rkward/plugins/x11device/export_new.xml
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export_new.xml	2007-02-23 21:38:46 UTC (rev 1463)
+++ trunk/rkward/rkward/plugins/x11device/export_new.xml	2007-02-24 01:17:01 UTC (rev 1464)
@@ -78,7 +78,7 @@
 			<tab id="tab_file_and_type" label="Filename/Type">
 				<row>
 					<column>
-						<browser size="medium" id="file" label="File name" initial="Rplot" filter="*.ps *.eps *.pdf *.png *.jpg *.jpeg"/>
+						<browser type="savefile" id="file" label="File name" initial="Rplot" filter="*.ps *.eps *.pdf *.png *.jpg *.jpeg"/>
 						<checkbox id="autoextension" value="1" value_unchecked="0" checked="true" label="Automatic File extension"/>
 					</column>
 					<column>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list