public Matrix getPanToViewTranslation ( ) { if ( viewState . getScale ( ) > 0 ) { double dX = - ( ( viewState . getX ( ) - viewState . getPanX ( ) ) * viewState . getScale ( ) ) + width / 2 ; double dY = ( viewState . getY ( ) - viewState . getPanY ( ) ) * viewState . getScale ( ) + height / 2 ; return new Matrix ( 1 , 0 , 0 , 1 , dX , dY ) ; } return new Matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) ; }
Return the translation of coordinates relative to the pan origin to view coordinates .