* @function LevelRenderer.Painter.prototype.resize * @description 区域大小变化后重绘。 * @return {LevelRenderer.Painter} this。
()
| 546 | * @return {LevelRenderer.Painter} this。 |
| 547 | */ |
| 548 | resize() { |
| 549 | var domRoot = this._domRoot; |
| 550 | domRoot.style.display = 'none'; |
| 551 | |
| 552 | var width = this._getWidth(); |
| 553 | var height = this._getHeight(); |
| 554 | |
| 555 | domRoot.style.display = ''; |
| 556 | |
| 557 | // 优化没有实际改变的resize |
| 558 | if (this._width != width || height != this._height) { |
| 559 | this._width = width; |
| 560 | this._height = height; |
| 561 | |
| 562 | domRoot.style.width = width + 'px'; |
| 563 | domRoot.style.height = height + 'px'; |
| 564 | |
| 565 | for (var id in this._layers) { |
| 566 | |
| 567 | this._layers[id].resize(width, height); |
| 568 | } |
| 569 | |
| 570 | this.refresh(null, true); |
| 571 | } |
| 572 | |
| 573 | return this; |
| 574 | } |
| 575 | |
| 576 | |
| 577 | /** |
nothing calls this directly
no test coverage detected