Jelajahi Sumber

Fix scale/rescale attribute/hooks.

Still buggy so not yet activated in the UI, but the hooks are at least
here.
Joel Martin 14 tahun lalu
induk
melakukan
58b4c53661
2 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 4 1
      include/canvas.js
  2. 1 0
      include/input.js

+ 4 - 1
include/canvas.js

@@ -38,7 +38,7 @@ cdef('target',         'dom',  null, 'Canvas element for VNC viewport');
 cdef('focusContainer', 'dom',  document, 'DOM element that traps keyboard input');
 cdef('true_color',     'bool', true, 'Request true color pixel data');
 cdef('colourMap',      'raw',  [], 'Colour map array (not true color)');
-cdef('scale',          'float', 1, 'VNC viewport scale factor');
+cdef('scale',          'float', 1.0, 'Viewport scale factor 0.0 - 1.0');
 
 cdef('render_mode',    'str', '', 'Canvas rendering mode (read-only)');
 
@@ -70,6 +70,9 @@ that.set_colourMap = function(val, idx) {
 
 that.set_render_mode = function () { throw("render_mode is read-only"); };
 
+that.set_scale = function(scale) { that.rescale(scale); };
+
+
 // Add some other getters/setters
 that.get_width = function() {
     return c_width;

+ 1 - 0
include/input.js

@@ -460,6 +460,7 @@ function cdef(v, type, defval, desc) {
 // Capability settings, default can be overridden
 cdef('target',         'dom',  document, 'DOM element that grabs mouse input');
 cdef('focused',        'bool', true, 'Capture and send mouse clicks/movement');
+cdef('scale',          'float', 1.0, 'Viewport scale factor 0.0 - 1.0');
 
 cdef('mouseButton',    'func', null, 'Handler for mouse button click/release');
 cdef('mouseMove',      'func', null, 'Handler for mouse movement');