mirror of
https://github.com/novnc/noVNC.git
synced 2026-06-09 05:44:38 +00:00
Properly encapsulate the scale in Display
Other parts of the code shouldn't have to care about this. Let Display convert between canvas coordinates and framebuffer coordinates.
This commit is contained in:
@@ -193,11 +193,11 @@
|
||||
},
|
||||
|
||||
absX: function (x) {
|
||||
return x + this._viewportLoc.x;
|
||||
return x / this._scale + this._viewportLoc.x;
|
||||
},
|
||||
|
||||
absY: function (y) {
|
||||
return y + this._viewportLoc.y;
|
||||
return y / this._scale + this._viewportLoc.y;
|
||||
},
|
||||
|
||||
resize: function (width, height) {
|
||||
@@ -589,8 +589,6 @@
|
||||
}
|
||||
|
||||
this._rescale(scaleRatio);
|
||||
|
||||
return scaleRatio; // so that the mouse, etc scale can be set
|
||||
},
|
||||
|
||||
// Private Methods
|
||||
|
||||
Reference in New Issue
Block a user