如何在木瓜观察器中使用平移工具

时间:2018-06-12 07:41:27

标签: javascript papaya

您好我曾尝试为木瓜查看器实施PAN工具但没有运气,我想出了这两个功能

papaya.viewer.Viewer.prototype.setCurrentPanLocation = function (xLoc, yLoc, sliceDirection) {

papaya.viewer.Viewer.prototype.setStartPanLocation = function (xLoc, yLoc, sliceDirection) {

任何人帮助

1 个答案:

答案 0 :(得分:0)

详细研究后终于找到答案

this.previousMousePosition.x = papaya.utilities.PlatformUtils.getMousePositionX(me);
this.previousMousePosition.y = papaya.utilities.PlatformUtils.getMousePositionY(me);
                    //  this.setStartPanLocationNew(Cord1.x, Cord1.y, this.mainImage.sliceDirection);
                    
this.setStartPanLocationNew(
                        this.convertScreenToImageCoordinateX(this.previousMousePosition.x, this.mainImage),
                        this.convertScreenToImageCoordinateY(this.previousMousePosition.y, this.mainImage),
                        this.mainImage.sliceDirection
                    );