Fixed the bug with crashing vncviewer when it works in the 
scaling mode and scale < 10%.
Scale part of vncviewer code improvements.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2232 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/ScaledPixelBuffer.h b/common/rfb/ScaledPixelBuffer.h
index ca0ddf5..b41c59a 100644
--- a/common/rfb/ScaledPixelBuffer.h
+++ b/common/rfb/ScaledPixelBuffer.h
@@ -49,8 +49,9 @@
     int getSrcWidth()  const { return src_width; }
     int getSrcHeight() const { return src_height; }
     int area() const { return scaled_width * scaled_height; }
-    int getScale() const { return int(scale_ratio * 100 + 0.5); }
-    double getScaleRatio() const { return scale_ratio; }
+    int getScale() const { return scale; }
+    double getScaleRatioX() const { return scale_ratio_x; }
+    double getScaleRatioY() const { return scale_ratio_y; }
 
     // Pixel manipulation routines
     inline U32 getSourcePixel(int x, int y);
@@ -74,8 +75,7 @@
     void setPF(const PixelFormat &pf);
 
     // Set the new scale, in percent
-    virtual void setScale(int scale) { setScaleRatio(double(scale)/100.0); }
-    virtual void setScaleRatio(double scale_ratio);
+    virtual void setScale(int scale);
 
     // Scale rect from the source image buffer to the destination buffer
     // using the current interpolation method
@@ -99,8 +99,10 @@
     int src_height;
     int scaled_width;
     int scaled_height;
+    int scale;
+    double scale_ratio_x;
+    double scale_ratio_y;
     PixelFormat pf;
-    double scale_ratio;
     unsigned int scaleFilterID;
     ScaleFilters scaleFilters;
     SFilterWeightTab *xWeightTabs;