Added rotate right/left buttons to default tools
BIN
images/rotateleft_grouphover.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
images/rotateleft_hover.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
images/rotateleft_pressed.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/rotateleft_rest.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
images/rotateright_grouphover.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
images/rotateright_hover.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
images/rotateright_pressed.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/rotateright_rest.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
@ -1153,6 +1153,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
doSingleZoomOutHandler = $.delegate( this, doSingleZoomOut ),
|
||||
onHomeHandler = $.delegate( this, onHome ),
|
||||
onFullScreenHandler = $.delegate( this, onFullScreen ),
|
||||
onRotateLeftHandler = $.delegate( this, onRotateLeft ),
|
||||
onRotateRightHandler = $.delegate( this, onRotateRight ),
|
||||
onFocusHandler = $.delegate( this, onFocus ),
|
||||
onBlurHandler = $.delegate( this, onBlur ),
|
||||
navImages = this.navImages,
|
||||
@ -1232,6 +1234,34 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
onBlur: onBlurHandler
|
||||
}));
|
||||
|
||||
buttons.push( this.rotateLeft = new $.Button({
|
||||
element: this.rotateLeftButton ? $.getElement( this.rotateLeftButton ) : null,
|
||||
clickTimeThreshold: this.clickTimeThreshold,
|
||||
clickDistThreshold: this.clickDistThreshold,
|
||||
tooltip: $.getString( "Tooltips.RotateLeft" ),
|
||||
srcRest: resolveUrl( this.prefixUrl, navImages.rotateleft.REST ),
|
||||
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateleft.GROUP ),
|
||||
srcHover: resolveUrl( this.prefixUrl, navImages.rotateleft.HOVER ),
|
||||
srcDown: resolveUrl( this.prefixUrl, navImages.rotateleft.DOWN ),
|
||||
onRelease: onRotateLeftHandler,
|
||||
onFocus: onFocusHandler,
|
||||
onBlur: onBlurHandler
|
||||
}));
|
||||
|
||||
buttons.push( this.rotateRight = new $.Button({
|
||||
element: this.rotateRightButton ? $.getElement( this.rotateRightButton ) : null,
|
||||
clickTimeThreshold: this.clickTimeThreshold,
|
||||
clickDistThreshold: this.clickDistThreshold,
|
||||
tooltip: $.getString( "Tooltips.RotateRight" ),
|
||||
srcRest: resolveUrl( this.prefixUrl, navImages.rotateright.REST ),
|
||||
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateright.GROUP ),
|
||||
srcHover: resolveUrl( this.prefixUrl, navImages.rotateright.HOVER ),
|
||||
srcDown: resolveUrl( this.prefixUrl, navImages.rotateright.DOWN ),
|
||||
onRelease: onRotateRightHandler,
|
||||
onFocus: onFocusHandler,
|
||||
onBlur: onBlurHandler
|
||||
}));
|
||||
|
||||
if( useGroup ){
|
||||
this.buttons = new $.ButtonGroup({
|
||||
buttons: buttons,
|
||||
@ -2116,6 +2146,38 @@ function onFullScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: The current rotation feature is limited to 90 degree turns.
|
||||
*/
|
||||
function onRotateLeft() {
|
||||
if ( this.viewport ) {
|
||||
var currRotation = this.viewport.getRotation();
|
||||
if (currRotation == 0) {
|
||||
currRotation = 270;
|
||||
}
|
||||
else {
|
||||
currRotation -= 90;
|
||||
}
|
||||
this.viewport.setRotation(currRotation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: The current rotation feature is limited to 90 degree turns.
|
||||
*/
|
||||
function onRotateRight() {
|
||||
if ( this.viewport ) {
|
||||
var currRotation = this.viewport.getRotation();
|
||||
if (currRotation == 270) {
|
||||
currRotation = 0;
|
||||
}
|
||||
else {
|
||||
currRotation += 90;
|
||||
}
|
||||
this.viewport.setRotation(currRotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onPrevious(){
|
||||
var previous = THIS[ this.hash ].sequence - 1;
|
||||
|