- context.Scissor( layerScissorBox.x, layerScissorBox.y, layerScissorBox.width, layerScissorBox.height );
+ GLint x = layerScissorBox.x;
+ GLint y = layerScissorBox.y;
+
+ if( orientation == 90 )
+ {
+ x = mViewportRectangle.height - (layerScissorBox.y + layerScissorBox.height);
+ y = layerScissorBox.x;
+ context.Scissor( x, y, layerScissorBox.height, layerScissorBox.width );
+ }
+ else if( orientation == 180 )
+ {
+ x = mViewportRectangle.width - (layerScissorBox.x + layerScissorBox.width);
+ y = mViewportRectangle.height - (layerScissorBox.y + layerScissorBox.height);
+ context.Scissor( x, y, layerScissorBox.width, layerScissorBox.height );
+ }
+ else if( orientation == 270 )
+ {
+ x = layerScissorBox.y;
+ y = mViewportRectangle.width - (layerScissorBox.x + layerScissorBox.width);
+ context.Scissor( x, y, layerScissorBox.height, layerScissorBox.width );
+ }
+ else
+ {
+ context.Scissor( x, y, layerScissorBox.width, layerScissorBox.height );
+ }
+