Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Openseadragon:旋转画布时奇怪的选择旋转_Javascript_Html5 Canvas_Openseadragon - Fatal编程技术网

Javascript Openseadragon:旋转画布时奇怪的选择旋转

Javascript Openseadragon:旋转画布时奇怪的选择旋转,javascript,html5-canvas,openseadragon,Javascript,Html5 Canvas,Openseadragon,我目前正在使用OpenSeadragon和PictureAE选择插件开发一个查看器,用于添加裁剪工具 选择效果很好,但当我旋转图像时,选择的旋转看起来很奇怪:它围绕左下角旋转,而不是围绕选择的中心旋转 :图像笔直时选择旋转的正常行为,以及图像旋转时的怪异行为 理想的效果是围绕选择的中心旋转 我使用以下代码初始化选择: var selection = viewer.selection({ element: null, // html element to use

我目前正在使用OpenSeadragon和PictureAE选择插件开发一个查看器,用于添加裁剪工具

选择效果很好,但当我旋转图像时,选择的旋转看起来很奇怪:它围绕左下角旋转,而不是围绕选择的中心旋转

:图像笔直时选择旋转的正常行为,以及图像旋转时的怪异行为

理想的效果是围绕选择的中心旋转

我使用以下代码初始化选择:

var selection = viewer.selection({
  element:                 null, // html element to use for overlay
  showSelectionControl:    true, // show button to toggle selection mode
  toggleButton:            null, // dom element to use as toggle button
  showConfirmDenyButtons:  true,
  styleConfirmDenyButtons: true,
  returnPixelCoordinates:  true,
  keyboardShortcut:        'c', // key to toggle selection mode
  rect:                    null, // initial selection as an OpenSeadragon.SelectionRect object
  startRotated:            false, // alternative method for drawing the selection; useful for rotated crops
  startRotatedHeight:      0.1, // only used if startRotated=true; value is relative to image height
  restrictToImage:         true, // true = do not allow any part of the selection to be outside the image
  onSelection:             function(rect) { viewer_crop_download(rect); },
  cancel : function(){ viewer_crop_disable(); },
  prefixUrl:     PREFIX_URL,
  navImages:
  {
    selection: {
     REST:   'selection_rest.png',
     GROUP:  'selection_grouphover.png',
     HOVER:  'selection_hover.png',
     DOWN:   'selection_pressed.png'
    },
    selectionConfirm: {
     REST:   'selection_confirm_rest.png',
     GROUP:  'selection_confirm_grouphover.png',
     HOVER:  'selection_confirm_hover.png',
     DOWN:   'selection_confirm_pressed.png'
    },
    selectionCancel: {
     REST:   'selection_cancel_rest.png',
     GROUP:  'selection_cancel_grouphover.png',
     HOVER:  'selection_cancel_hover.png',
     DOWN:   'selection_cancel_pressed.png'
    },
  }
});
OpenSeadragon:

PictureAE选择插件:


谢谢

看起来可能是选择插件的错误。这里的一些讨论:确实如此,所以我将自己实现一个修复。听起来不错。如果可以,请共享修复!