aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-09-11 15:09:09 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-09-11 15:09:09 +0000
commit2baaaecc06fd07fdf0d524c9395aa3d185d42aa7 (patch)
tree0b534ca73a54fb2c68ed110a42c4ab60e7f885a5
parent74ea5f3cd7a1bb6b2e3d865def15ebf44416cbc8 (diff)
downloadtigervnc-2baaaecc06fd07fdf0d524c9395aa3d185d42aa7.tar.gz
tigervnc-2baaaecc06fd07fdf0d524c9395aa3d185d42aa7.zip
Small the DesktopWindow class code improvements.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@663 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--win/vncviewer/DesktopWindow.cxx8
-rw-r--r--win/vncviewer/DesktopWindow.h3
2 files changed, 5 insertions, 6 deletions
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx
index 8460f581..197449d2 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -973,8 +973,8 @@ void DesktopWindow::setAutoScaling(bool as) {
if (as) fitBufferToWindow();
}
-void DesktopWindow::setDesktopScale(int scale) {
- buffer->setScale(scale);
+void DesktopWindow::setDesktopScaleRatio(double scale_ratio) {
+ buffer->setScaleRatio(scale_ratio);
InvalidateRect(frameHandle, 0, FALSE);
calculateScrollBars();
if (isToolbarEnabled()) refreshToolbarButtons();
@@ -998,9 +998,7 @@ void DesktopWindow::fitBufferToWindow(bool repaint) {
} else {
scale_ratio = double(client_size.width()) / buffer->getSrcWidth();
}
- buffer->setScaleRatio(scale_ratio);
- if (repaint) InvalidateRect(frameHandle, 0, TRUE);
- if (isToolbarEnabled()) refreshToolbarButtons();
+ setDesktopScaleRatio(scale_ratio);
}
void
diff --git a/win/vncviewer/DesktopWindow.h b/win/vncviewer/DesktopWindow.h
index e8f87bc6..9c2f1f3e 100644
--- a/win/vncviewer/DesktopWindow.h
+++ b/win/vncviewer/DesktopWindow.h
@@ -84,7 +84,8 @@ namespace rfb {
void setColour(int i, int r, int g, int b) {buffer->setColour(i, r, g, b);}
void setAutoScaling(bool as);
bool isAutoScaling() const { return autoScaling; }
- void setDesktopScale(int scale);
+ void setDesktopScaleRatio(double scale_ratio);
+ void setDesktopScale(int scale) { setDesktopScaleRatio(double(scale)/100); }
int getDesktopScale() const { return buffer->getScale(); }
void fitBufferToWindow(bool repaint = true);