Open GoogleCodeExporter opened 8 years ago
I think MinimumScale is calculated wrongly. Here is patch which works for me:
--- a/eclipse_projects/androidVNC/src/android/androidVNC/AbstractBitmapData.java
+++ b/eclipse_projects/androidVNC/src/android/androidVNC/AbstractBitmapData.java
@@ -62,15 +62,14 @@ abstract class AbstractBitmapData {
*/
float getMinimumScale()
{
- double scale = 0.75;
int displayWidth = vncCanvas.getWidth();
int displayHeight = vncCanvas.getHeight();
- for (; scale >= 0; scale -= 0.25)
- {
- if (scale * bitmapwidth < displayWidth || scale *
bitmapheight < displayHeight)
- break;
- }
- return (float)(scale + 0.25);
+ float scaleW = (float) displayWidth / bitmapwidth;
+ float scaleH = (float) displayHeight/ bitmapheight;
+
+ //select smaller
+ float scale = (scaleW < scaleH)?scaleW:scaleH;
+ return scale;
}
/**
------------------
Tested with server 1680x1050px, client 1024x600px. And then scale is about
.57142857, I don't see reason why it should be rounded (or even rounded to the
nearest scaling-step, now it is independent for scaling-step).
Original comment by aapo.rantalainen
on 27 Mar 2012 at 12:47
Original issue reported on code.google.com by
aapo.rantalainen
on 15 Feb 2012 at 7:32