MoveMagnifier.js 722 B

1234567891011121314151617181920212223242526
  1. import { coordinate } from "../Coordinate";
  2. import { dataService } from "../Service/DataService";
  3. export default class MoveMagnifier {
  4. constructor() {}
  5. moveFullMagnifier(position, magnifierId, index) {
  6. let magnifier = dataService.getMagnifier(magnifierId);
  7. //移动放大镜清除图片信息
  8. magnifier.setPhotoUrl(null)
  9. magnifier.setPhotoImg(null)
  10. if (index == 0) {
  11. magnifier.setPosition(position);
  12. } else {
  13. const popPosition = coordinate.getScreenXY(position);
  14. magnifier.popPosition = {
  15. x: popPosition.x,
  16. y: popPosition.y,
  17. };
  18. magnifier.setPopPosition(position);
  19. }
  20. }
  21. }
  22. const moveMagnifier = new MoveMagnifier();
  23. export { moveMagnifier };