Open duaiyun1314 opened 4 weeks ago
if (this.model.frameWidth > showWidth || this.model.getFrameHeight() > showHeight) { // 图片缩放后,大小不足以填满取景框 let xScale = this.model.frameWidth / showWidth; let yScale = this.model.getFrameHeight() / showHeight; let newScale = Math.max(xScale, yScale); this.model.scale = this.model.scale * newScale; hilog.error(0, "CropView", `Image new show0 at (${showX}, ${showY}) new scale:${this.model.scale} frameX:${frameX}`) showX *= newScale; showY *= newScale; hilog.error(0, "CropView", `Image new show at (${showX}, ${showY}) new scale:${this.model.scale} frameX:${frameX}`) }
这块代码执行后model.scale发生改变,与之相关的showWidth、showHeight、imageX、imageY,scale等变量都应该重新计算下,否则后面使用这些变量的地方都将不准
确实可能有这个问题,等这段时间忙完再来完善下
这块代码执行后model.scale发生改变,与之相关的showWidth、showHeight、imageX、imageY,scale等变量都应该重新计算下,否则后面使用这些变量的地方都将不准