@@ -35,16 +35,20 @@ function getOrientationMarkers(
3535 const markers = {
3636 top : oppositeColumnString ,
3737 left : oppositeRowString ,
38+ right : rowString ,
39+ bottom : columnString ,
3840 } ;
3941
4042 // If any vertical or horizontal flips are applied, change the orientation strings ahead of
4143 // the rotation applications
4244 if ( isFlippedVertically ) {
4345 markers . top = invertOrientationString ( markers . top ) ;
46+ markers . bottom = invertOrientationString ( markers . bottom ) ;
4447 }
4548
4649 if ( isFlippedHorizontally ) {
4750 markers . left = invertOrientationString ( markers . left ) ;
51+ markers . right = invertOrientationString ( markers . right ) ;
4852 }
4953
5054 // Swap the labels accordingly if the viewport has been rotated
@@ -53,16 +57,22 @@ function getOrientationMarkers(
5357 return {
5458 top : markers . left ,
5559 left : invertOrientationString ( markers . top ) ,
60+ right : invertOrientationString ( markers . bottom ) ,
61+ bottom : markers . right , // left
5662 } ;
5763 } else if ( rotationDegrees === - 90 || rotationDegrees === 270 ) {
5864 return {
5965 top : invertOrientationString ( markers . left ) ,
6066 left : markers . top ,
67+ bottom : markers . left ,
68+ right : markers . bottom ,
6169 } ;
6270 } else if ( rotationDegrees === 180 || rotationDegrees === - 180 ) {
6371 return {
6472 top : invertOrientationString ( markers . top ) ,
6573 left : invertOrientationString ( markers . left ) ,
74+ bottom : invertOrientationString ( markers . bottom ) ,
75+ right : invertOrientationString ( markers . right ) ,
6676 } ;
6777 }
6878
@@ -76,6 +86,11 @@ class ViewportOrientationMarkers extends PureComponent {
7686 rotationDegrees : PropTypes . number . isRequired ,
7787 isFlippedVertically : PropTypes . bool . isRequired ,
7888 isFlippedHorizontally : PropTypes . bool . isRequired ,
89+ orientationMarkers : PropTypes . arrayOf ( PropTypes . string ) ,
90+ } ;
91+
92+ static defaultProps = {
93+ orientationMarkers : [ 'top' , 'left' ] ,
7994 } ;
8095
8196 render ( ) {
@@ -85,6 +100,7 @@ class ViewportOrientationMarkers extends PureComponent {
85100 rotationDegrees,
86101 isFlippedVertically,
87102 isFlippedHorizontally,
103+ orientationMarkers,
88104 } = this . props ;
89105
90106 if ( ! rowCosines || ! columnCosines ) {
@@ -99,10 +115,19 @@ class ViewportOrientationMarkers extends PureComponent {
99115 isFlippedHorizontally
100116 ) ;
101117
118+ const getMarkers = orientationMarkers =>
119+ orientationMarkers . map ( ( m , index ) => (
120+ < div
121+ className = { `${ m } -mid orientation-marker` }
122+ key = { `${ m } -mid orientation-marker` }
123+ >
124+ { markers [ m ] }
125+ </ div >
126+ ) ) ;
127+
102128 return (
103129 < div className = "ViewportOrientationMarkers noselect" >
104- < div className = "top-mid orientation-marker" > { markers . top } </ div >
105- < div className = "left-mid orientation-marker" > { markers . left } </ div >
130+ { getMarkers ( orientationMarkers ) }
106131 </ div >
107132 ) ;
108133 }
0 commit comments