Commit aef97bc1 authored by Chen Jiping's avatar Chen Jiping

fix:调整上传图片显示的scale

parent f38618f9
......@@ -160,8 +160,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
const rate1 = this.canvasWidth / bg.width;
const rate2 = this.canvasHeight / bg.height;
const rate = Math.max(rate1, rate2);
bg.setScaleXY(rate);
//const rate = Math.max(rate1, rate2);
//bg.setScaleXY(rate);
bg.scaleX = rate1;
bg.scaleY = rate2;
bg.x = this.canvasWidth / 2;
......@@ -980,8 +982,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
private loadHotZonePic(pic: HotZoneImg, url) {
const baseLen = this.hotZoneImgSize * this.mapScale;
pic.load(url).then(() => {
const s = getMinScale(pic, baseLen);
pic.setScaleXY(s);
//const s = getMinScale(pic, baseLen);
pic.setScaleXY(this.mapScale);
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment