Commit 1a2371fc authored by Joel Martin's avatar Joel Martin

include/canvas.js: missed scale fix.

parent 58b4c536
...@@ -38,7 +38,7 @@ cdef('target', 'dom', null, 'Canvas element for VNC viewport'); ...@@ -38,7 +38,7 @@ cdef('target', 'dom', null, 'Canvas element for VNC viewport');
cdef('focusContainer', 'dom', document, 'DOM element that traps keyboard input'); cdef('focusContainer', 'dom', document, 'DOM element that traps keyboard input');
cdef('true_color', 'bool', true, 'Request true color pixel data'); cdef('true_color', 'bool', true, 'Request true color pixel data');
cdef('colourMap', 'raw', [], 'Colour map array (not true color)'); cdef('colourMap', 'raw', [], 'Colour map array (not true color)');
cdef('scale', 'float', 1.0, 'Viewport scale factor 0.0 - 1.0'); cdef('scale', 'float', 1.0, 'Viewport scale factor 0.1 - 1.0');
cdef('render_mode', 'str', '', 'Canvas rendering mode (read-only)'); cdef('render_mode', 'str', '', 'Canvas rendering mode (read-only)');
...@@ -235,6 +235,12 @@ that.rescale = function(factor) { ...@@ -235,6 +235,12 @@ that.rescale = function(factor) {
return; return;
} }
if (factor > 1.0) {
factor = 1.0;
} else if (factor < 0.1) {
factor = 0.1;
}
if (conf.scale === factor) { if (conf.scale === factor) {
//Util.Debug("Canvas already scaled to '" + factor + "'"); //Util.Debug("Canvas already scaled to '" + factor + "'");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment