MCPcopy Create free account
hub / github.com/apache/cloudstack / _rescale

Method _rescale

systemvm/agent/noVNC/core/display.js:456–472  ·  view source on GitHub ↗
(factor)

Source from the content-addressed store, hash-verified

454 // ===== PRIVATE METHODS =====
455
456 _rescale(factor) {
457 this._scale = factor;
458 const vp = this._viewportLoc;
459
460 // NB(directxman12): If you set the width directly, or set the
461 // style width to a number, the canvas is cleared.
462 // However, if you set the style width to a string
463 // ('NNNpx'), the canvas is scaled without clearing.
464 const width = factor * vp.w + 'px';
465 const height = factor * vp.h + 'px';
466
467 if ((this._target.style.width !== width) ||
468 (this._target.style.height !== height)) {
469 this._target.style.width = width;
470 this._target.style.height = height;
471 }
472 }
473
474 _setFillColor(color) {
475 const newStyle = 'rgb(' + color[0] + ',' + color[1] + ',' + color[2] + ')';

Callers 3

scaleMethod · 0.95
viewportChangeSizeMethod · 0.95
autoscaleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected