public Matrix getWorldToViewTransformation ( ) { if ( viewState . getScale ( ) > 0 ) { double dX = - ( viewState . getX ( ) * viewState . getScale ( ) ) + width / 2 ; double dY = viewState . getY ( ) * viewState . getScale ( ) + height / 2 ; return new Matrix ( viewState . getScale ( ) , 0 , 0 , - viewState . getScale ( ) , dX , dY ) ; } return new Matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) ; }
Return the world - to - view space transformation matrix .