Skip to content
Snippets Groups Projects
Commit cb99fade authored by jlf44's avatar jlf44
Browse files

Pass through the viewDirection to BookView and fix image pairing for R-to-L view

parent 40d51b8c
Branches
Tags
No related merge requests found
...@@ -410,6 +410,7 @@ ...@@ -410,6 +410,7 @@
rightIndex = [], rightIndex = [],
topIndex = [], topIndex = [],
bottomIndex = [], bottomIndex = [],
viewAdjustedImgIndex = this.currentImgIndex,
_this = this; _this = this;
this.focusImages = []; this.focusImages = [];
...@@ -418,11 +419,17 @@ ...@@ -418,11 +419,17 @@
// don't do any stitching, display like an imageView // don't do any stitching, display like an imageView
stitchList = [this.currentImg]; stitchList = [this.currentImg];
} else if (this.viewingHint === 'paged') { } else if (this.viewingHint === 'paged') {
// For RTL work out index from right hand side.
if (this.viewingDirection === 'right-to-left') {
viewAdjustedImgIndex = (this.imagesList.length-1) - this.currentImgIndex;
}
// determine the other image for this pair based on index and viewingDirection // determine the other image for this pair based on index and viewingDirection
if (this.currentImgIndex === 0 || this.currentImgIndex === this.imagesList.length-1) { if (viewAdjustedImgIndex === 0 || viewAdjustedImgIndex === this.imagesList.length-1) {
//first page (front cover) or last page (back cover), display on its own //first page (front cover) or last page (back cover), display on its own
stitchList = [this.currentImg]; stitchList = [this.currentImg];
} else if (this.currentImgIndex % 2 === 0) { } else if (viewAdjustedImgIndex % 2 === 0) {
// even, get previous page. set order in array based on viewingDirection // even, get previous page. set order in array based on viewingDirection
switch (this.viewingDirection) { switch (this.viewingDirection) {
case "left-to-right": case "left-to-right":
...@@ -430,8 +437,8 @@ ...@@ -430,8 +437,8 @@
stitchList = [this.imagesList[this.currentImgIndex-1], this.currentImg]; stitchList = [this.imagesList[this.currentImgIndex-1], this.currentImg];
break; break;
case "right-to-left": case "right-to-left":
rightIndex[0] = this.currentImgIndex-1; rightIndex[0] = this.currentImgIndex+1;
stitchList = [this.currentImg, this.imagesList[this.currentImgIndex-1]]; stitchList = [this.currentImg, this.imagesList[this.currentImgIndex+1]];
break; break;
case "top-to-bottom": case "top-to-bottom":
topIndex[0] = this.currentImgIndex-1; topIndex[0] = this.currentImgIndex-1;
...@@ -452,8 +459,8 @@ ...@@ -452,8 +459,8 @@
stitchList = [this.currentImg, this.imagesList[this.currentImgIndex+1]]; stitchList = [this.currentImg, this.imagesList[this.currentImgIndex+1]];
break; break;
case "right-to-left": case "right-to-left":
leftIndex[0] = this.currentImgIndex+1; leftIndex[0] = this.currentImgIndex-1;
stitchList = [this.imagesList[this.currentImgIndex+1], this.currentImg]; stitchList = [this.imagesList[this.currentImgIndex-1], this.currentImg];
break; break;
case "top-to-bottom": case "top-to-bottom":
bottomIndex[0] = this.currentImgIndex+1; bottomIndex[0] = this.currentImgIndex+1;
......
...@@ -82,9 +82,10 @@ ...@@ -82,9 +82,10 @@
_this.removeBookView(); _this.removeBookView();
this.viewingDirection = _this.manifest.getViewingDirection();
//reset imagemodes and then remove any imageModes that are not available as a focus //reset imagemodes and then remove any imageModes that are not available as a focus
//add getting rtl value //add getting rtl value
if(_this.manifest.getViewingDirection() == 'right-to-left'){ if(this.viewingDirection == 'right-to-left'){
_this.vDirectionStatus = 'rtl'; _this.vDirectionStatus = 'rtl';
} }
else{ else{
...@@ -802,6 +803,7 @@ ...@@ -802,6 +803,7 @@
imagesListRtl: this.imagesListRtl, imagesListRtl: this.imagesListRtl,
imagesListLtr: this.imagesListLtr, imagesListLtr: this.imagesListLtr,
vDirectionStatus: this.vDirectionStatus, vDirectionStatus: this.vDirectionStatus,
viewingDirection: this.viewingDirection,
osdOptions: this.windowOptions, osdOptions: this.windowOptions,
bottomPanelAvailable: this.bottomPanelAvailable bottomPanelAvailable: this.bottomPanelAvailable
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment