Resets the scale of the Megaplot Scene.
()
| 507 | |
| 508 | /** Resets the scale of the Megaplot Scene. */ |
| 509 | private resetScale() { |
| 510 | if (this.container == null || this.scene == null) return; |
| 511 | const {width, height} = this.container.getBoundingClientRect(); |
| 512 | if (width === 0 || height === 0) return; |
| 513 | const smaller = height < width ? height : width; |
| 514 | this.scene.scale.x = smaller * HEURISTIC_SCALE_FACTOR; |
| 515 | this.scene.scale.y = smaller * HEURISTIC_SCALE_FACTOR; |
| 516 | this.scene.offset.x = Math.ceil(width / 2); |
| 517 | this.scene.offset.y = Math.floor(height / 2) - CELL_PADDING - TEXT_SIZE; |
| 518 | } |
| 519 | |
| 520 | /** Resizes the Megaplot Scene canvas and resets the scale. */ |
| 521 | private resize() { |
no outgoing calls
no test coverage detected