#229 Scale clusters properly (#230)

This commit is contained in:
Tomek Święcicki
2019-05-31 15:56:26 +02:00
committed by Henning Jacobs
parent b069d61ef7
commit dcf1fcc2d4
2 changed files with 4 additions and 3 deletions

View File

@@ -498,7 +498,7 @@ export default class App {
const status = this.clusterStatuses.get(cluster.id)
let clusterBox = clusterComponentById[cluster.id]
if (!clusterBox) {
clusterBox = new Cluster(cluster, status, this.tooltip)
clusterBox = new Cluster(cluster, status, this.tooltip, this.config)
this.viewContainer.addChild(clusterBox)
} else {
clusterBox.cluster = cluster

View File

@@ -4,11 +4,12 @@ import App from './app.js'
const PIXI = require('pixi.js')
export default class Cluster extends PIXI.Graphics {
constructor (cluster, status, tooltip) {
constructor (cluster, status, tooltip, config) {
super()
this.cluster = cluster
this.status = status
this.tooltip = tooltip
this.config = config
}
destroy() {
@@ -84,7 +85,7 @@ export default class Cluster extends PIXI.Graphics {
Math.floor(this.podsPerRowMaster * App.current.sizeOfPodPx + App.current.heightOfTopHandlePx + (App.current.sizeOfPodPx * 2) + 2)
)
const maxWidth = window.innerWidth - (this.heightOfWorkerNodePx * 1.2)
const maxWidth = (window.innerWidth * (1/this.config.initialScale)) - (this.heightOfWorkerNodePx * 1.2)
for (const nodeName of Object.keys(this.cluster.nodes).sort()) {
const node = this.cluster.nodes[nodeName]