(factor)
| 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] + ')'; |
no outgoing calls
no test coverage detected