From 085d2e6bafa1afd1eed411490da4deb78f39a8d1 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 5 Feb 2021 10:11:23 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E5=BA=94=E7=BC=A9=E6=94=BE=E5=92=8C=E9=87=8D=E7=BD=AE=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 8 ++++++++ .../collection-tools.component.scss | 9 +++++++++ .../collection-tools.component.ts | 8 ++++++++ src/app/working-area/working-area.component.ts | 2 +- src/assets/images/适应缩放.png | Bin 0 -> 268 bytes src/assets/images/重置缩放.png | Bin 0 -> 506 bytes 6 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/assets/images/适应缩放.png create mode 100644 src/assets/images/重置缩放.png diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 7a67b56..e84e780 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -22,6 +22,14 @@ 多选 + + + 适应缩放 + + + + 重置缩放 + tv create diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 3ca4bcf..95aec14 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -25,6 +25,15 @@ align-items:center; min-height: 40px; background-color: #fff; + .zoom{ + display: flex; + align-items: center; + margin-left: 15px; + cursor: pointer; + img{ + margin-right: 3px; + } + } .nameShow{ cursor: pointer; user-select: none; diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 12fef73..a88ea02 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -138,6 +138,14 @@ export class CollectionToolsComponent implements OnInit { this.isImgNumCss = false } } + //适应缩放 + adaptZoom(){ + this.canvas.zoomFit() + } + //重置缩放 + resetZoom(){ + this.canvas.resetCamera2D() + } //右侧div边框宽度调节 rightDivMouseDown(e){ document.onmousemove = (ev) => { diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 0f47f43..20dfa38 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -458,7 +458,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 重置相机 */ - private resetCamera2D() { + public resetCamera2D() { this.camera2D.scale.set(1); this.camera2D.x = (this.app.view.width - this.backgroundImage.width) / 2; this.camera2D.y = (this.app.view.height - this.backgroundImage.height) / 2; diff --git a/src/assets/images/适应缩放.png b/src/assets/images/适应缩放.png new file mode 100644 index 0000000000000000000000000000000000000000..818de8929a87e35d230a0758af553502787ae15b GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2co&H|6fVg?3oArNM~bhqvgP;j58 zi(`mI@7l>1c@G)zxSU_{zk^p|p|nZP0gj#vqBj~uB^r5e@g8F92~e|0IXUstq!qpo zRJX~*LR69nNcaG-0-#DW=1eh$gx20EfX_pX+GUEVkmF>J zl8sm+tW+u#1Oa^C*K4H|q9}rt(i~xP99tlBY?VA54lm<4re?F5mG5~TMNve(UXL8d zq4eW7mc(lScWbiw(0Dw)=ytoSUH1|MfhOk0&5?#F)(MqTFI)j{bUGa}!4>nG_nFZ5 z{XA)F8=-HKxRNAEv{e3plv0D=FWt-w1Me#`ee7+HbOlquIpwd zd7hX34#O~Wn9s~+Ge-y^Z2-8+yX=leBkntLT~|wHS6M2DshF>WQP|vEb{xkKMmFD_ zk)E2M_mom(jN5}Ra~IBhK7X`((15ER3&}cN? wtJUiBa=ARO*X#GCN6(6%*#qJ-|AheX4ee5k=_KO^qyPW_07*qoM6N<$g2Fr9J^%m! literal 0 HcmV?d00001