#6 do not use window.innerWidth directly
This commit is contained in:
@@ -129,10 +129,10 @@ export default class App {
|
||||
|
||||
const menuBar = new PIXI.Graphics()
|
||||
menuBar.beginFill(this.theme.secondaryColor, 0.8)
|
||||
menuBar.drawRect(0, 0, window.innerWidth, 28)
|
||||
menuBar.drawRect(0, 0, this.renderer.width, 28)
|
||||
menuBar.lineStyle(2, this.theme.secondaryColor, 0.8)
|
||||
menuBar.moveTo(0, 28)
|
||||
menuBar.lineTo(window.innerWidth, 28)
|
||||
menuBar.lineTo(this.renderer.width, 28)
|
||||
menuBar.lineStyle(1, this.theme.primaryColor, 1)
|
||||
menuBar.drawRect(20, 3, 200, 22)
|
||||
this.stage.addChild(menuBar)
|
||||
@@ -206,7 +206,7 @@ export default class App {
|
||||
const angle = Math.random()*Math.PI*2
|
||||
const cos = Math.cos(angle)
|
||||
const sin = Math.sin(angle)
|
||||
const distance = Math.max(200, Math.random() * Math.min(window.innerWidth, window.innerHeight))
|
||||
const distance = Math.max(200, Math.random() * Math.min(this.renderer.width, this.renderer.height))
|
||||
// blur filter looks cool, but has huge performance penalty
|
||||
// const blur = new PIXI.filters.BlurFilter(20, 2)
|
||||
// pod.filters = [blur]
|
||||
|
||||
Reference in New Issue
Block a user