text: export default function resize() {
    var curBaseScale = this.baseScale
  
    if (this.width / this.height > this.defaultWidth / this.defaultHeight) {
      this.baseScale = this.height / this.defaultHeight
      this.baseTransX = Math.abs(this.width - this.defaultWidth * this.baseScale) / (2 * this.baseScale)
    } else {
      this.baseScale = this.width / this.defaultWidth
      this.baseTransY = Math.abs(this.height - this.defaultHeight * this.baseScale) / (2 * this.baseScale)
    }
  
    this.scale *= this.baseScale / curBaseScale
    this.transX *= this.baseScale / curBaseScale
    this.transY *= this.baseScale / curBaseScale
  }