From 819c5c747dd15a785f22221c262b178fd99c89fc Mon Sep 17 00:00:00 2001 From: j Date: Tue, 6 Mar 2018 18:16:21 +0530 Subject: [PATCH] update area via options --- source/UI/js/Image/ImageViewer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/UI/js/Image/ImageViewer.js b/source/UI/js/Image/ImageViewer.js index 00cb7855..5e895127 100644 --- a/source/UI/js/Image/ImageViewer.js +++ b/source/UI/js/Image/ImageViewer.js @@ -43,6 +43,14 @@ Ox.ImageViewer = function(options, self) { }) .options(options || {}) .update({ + area: function() { + if (self.options.area && self.options.area.length == 4) { + var centerAndZoom = getCenterAndZoom(self.options.area); + self.options.center = centerAndZoom.center; + self.options.zoom = centerAndZoom.zoom; + setCenterAndZoom(true, true); + } + }, center: function() { setCenterAndZoom(true, true); },