-
Hi! There Is any possibility disabled to move images outside the screen? or turn ON 'moving' option only when image doesn't fit to screen height or width? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If someone looking for the answer it's helped me. or read this #429 var maxOffsetPercentage = 0.9;move: function (event) { var viewerData = viewer.viewerData; |
Beta Was this translation helpful? Give feedback.
If someone looking for the answer it's helped me.
You should use "move" method like example below
or read this #429
var maxOffsetPercentage = 0.9;move: function (event) {
var viewerData = viewer.viewerData;
var imageData = viewer.imageData;
var maxOffsetHorizontal = viewerData.width * maxOffsetPercentage;
var maxOffsetVertical = viewerData.height * maxOffsetPercentage;
var detail = event.detail;
var left = detail.x;
var top = detail.y;
var right = viewerData.width - (left + imageData.width);
var bottom = viewerData.height - (top + imageData.height);
if (
// Move left
(detail.x < detail.oldX && right > 0 && right > maxOffsetHorizontal)
// Move right
|| (det…