()
| 1361 | } |
| 1362 | |
| 1363 | adjustSizeFull() { |
| 1364 | const ratio = this.wrapper.documentClientWidth / this.wrapper.documentClientHeight; |
| 1365 | |
| 1366 | if (this.zoom === false && this.textTool.active === false) { |
| 1367 | if (this.size.w > this.wrapper.documentClientWidth || |
| 1368 | this.size.h > this.wrapper.documentClientHeight) { |
| 1369 | const newRelation = ratio < this.size.ratio; |
| 1370 | this.ratioRelation = newRelation; |
| 1371 | if (newRelation) { |
| 1372 | this.canvas.style.width = `${this.wrapper.clientWidth}px`; |
| 1373 | this.canvas.style.height = 'auto'; |
| 1374 | } else { |
| 1375 | this.canvas.style.width = 'auto'; |
| 1376 | this.canvas.style.height = `${this.wrapper.clientHeight}px`; |
| 1377 | } |
| 1378 | |
| 1379 | } else { |
| 1380 | this.canvas.style.width = 'auto'; |
| 1381 | this.canvas.style.height = 'auto'; |
| 1382 | this.ratioRelation = 0; |
| 1383 | } |
| 1384 | this.scroller.style.overflow = 'hidden'; |
| 1385 | } else { |
| 1386 | if (this.zoom === false) { |
| 1387 | this.scroller.style.overflow = 'hidden'; |
| 1388 | } else { |
| 1389 | this.scroller.style.overflow = 'scroll'; |
| 1390 | } |
| 1391 | this.canvas.style.width = `${this.size.w * this.zoomFactor}px`; |
| 1392 | this.canvas.style.height = `${this.size.h * this.zoomFactor}px`; |
| 1393 | this.ratioRelation = 0; |
| 1394 | } |
| 1395 | this.syncToolElement(); |
| 1396 | this.select.draw(); |
| 1397 | } |
| 1398 | |
| 1399 | resize(x, y) { |
| 1400 | this.info.innerHTML = `${x}<span>x</span>${y}<br>${(this.originalMime || 'png').replace('image/', '')}`; |
no test coverage detected