changeset 1129:dafd805c02be

Fix bug noticed by Matthew Flaschen, applet size factors are now doubles instead of ints.
author Deepak Bhole <dbhole@redhat.com>
date Sat, 18 Oct 2008 16:08:37 -0400
parents cd0b1ad5b02c
children eb9d7dcd692c
files ChangeLog plugin/icedtea/sun/applet/PluginAppletViewer.java
diffstat 2 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 18 16:16:41 2008 +0200
+++ b/ChangeLog	Sat Oct 18 16:08:37 2008 -0400
@@ -1,3 +1,8 @@
+2008-10-17  Deepak Bhole  <dbhole@redhat.com>
+
+	* plugin/icedtea/sun/applet/PluginAppletViewer.java: Make applet size
+	factors doubles instead of ints. 
+
 2008-10-18  Matthias Klose  <doko@ubuntu.com>
 
 	* Makefile.am: Write a summary of the jtreg test results.
--- a/plugin/icedtea/sun/applet/PluginAppletViewer.java	Sat Oct 18 16:16:41 2008 +0200
+++ b/plugin/icedtea/sun/applet/PluginAppletViewer.java	Sat Oct 18 16:08:37 2008 -0400
@@ -134,8 +134,8 @@
      
      private static PluginCallRequestFactory requestFactory;
      
-     private int proposedHeightFactor;
-     private int proposedWidthFactor;
+     private double proposedHeightFactor;
+     private double proposedWidthFactor;
 
      /**
       * Null constructor to allow instantiation via newInstance()
@@ -159,15 +159,15 @@
          
          
          // we intercept height and width specifications here because 
-         proposedHeightFactor = 1;
-         proposedWidthFactor = 1;
+         proposedHeightFactor = 1.0;
+         proposedWidthFactor = 1.0;
 
          if (atts.get("heightPercentage") != null) {
-        	 proposedHeightFactor = (Integer) atts.get("heightPercentage")/100;
+        	 proposedHeightFactor = (Integer) atts.get("heightPercentage")/100.0;
          }
          
          if (((String) atts.get("width")).endsWith("%")) {
-        	 proposedWidthFactor = (Integer) atts.get("widthPercentage")/100;
+        	 proposedWidthFactor = (Integer) atts.get("widthPercentage")/100.0;
          }
  
          AccessController.doPrivileged(new PrivilegedAction() {
@@ -390,8 +390,8 @@
         	 String[] dimMsg = message.split(" ");
         	 // 0 => width, 1=> width_value, 2 => height, 3=> height_value
         	 
-        	 int height = proposedHeightFactor*Integer.parseInt(dimMsg[3]);
-        	 int width = proposedWidthFactor*Integer.parseInt(dimMsg[1]);
+        	 int height = (int) (proposedHeightFactor*Integer.parseInt(dimMsg[3]));
+        	 int width = (int) (proposedWidthFactor*Integer.parseInt(dimMsg[1]));
 
         	 if (panel instanceof NetxPanel)
         		 ((NetxPanel) panel).updateSizeInAtts(height, width);