@@ -24,7 +24,18 @@ export default function widgetBehavior(publicAPI, model) {
24
24
let isScrolling = false ;
25
25
let previousPosition ;
26
26
27
- macro . setGet ( publicAPI , model , [ 'keepOrthogonality' ] ) ;
27
+ macro . setGet ( publicAPI , model , [
28
+ 'keepOrthogonality' ,
29
+ { type : 'object' , name : 'cursorStyles' } ,
30
+ ] ) ;
31
+
32
+ // Set default value for cursorStyles
33
+ publicAPI . setCursorStyles ( {
34
+ [ InteractionMethodsName . TranslateCenter ] : 'move' ,
35
+ [ InteractionMethodsName . RotateLine ] : 'alias' ,
36
+ [ InteractionMethodsName . TranslateAxis ] : 'pointer' ,
37
+ default : 'default' ,
38
+ } ) ;
28
39
29
40
publicAPI . setEnableTranslation = ( enable ) => {
30
41
model . representations [ 0 ] . setPickable ( enable ) ; // line handle
@@ -115,19 +126,24 @@ export default function widgetBehavior(publicAPI, model) {
115
126
} ;
116
127
117
128
publicAPI . updateCursor = ( ) => {
118
- switch ( publicAPI . getActiveInteraction ( ) ) {
119
- case InteractionMethodsName . TranslateCenter :
120
- model . _apiSpecificRenderWindow . setCursor ( 'move' ) ;
121
- break ;
122
- case InteractionMethodsName . RotateLine :
123
- model . _apiSpecificRenderWindow . setCursor ( 'alias' ) ;
124
- break ;
125
- case InteractionMethodsName . TranslateAxis :
126
- model . _apiSpecificRenderWindow . setCursor ( 'pointer' ) ;
127
- break ;
128
- default :
129
- model . _apiSpecificRenderWindow . setCursor ( 'default' ) ;
130
- break ;
129
+ const cursorStyles = publicAPI . getCursorStyles ( ) ;
130
+ if ( cursorStyles ) {
131
+ switch ( publicAPI . getActiveInteraction ( ) ) {
132
+ case InteractionMethodsName . TranslateCenter :
133
+ model . _apiSpecificRenderWindow . setCursor (
134
+ cursorStyles . translateCenter
135
+ ) ;
136
+ break ;
137
+ case InteractionMethodsName . RotateLine :
138
+ model . _apiSpecificRenderWindow . setCursor ( cursorStyles . rotateLine ) ;
139
+ break ;
140
+ case InteractionMethodsName . TranslateAxis :
141
+ model . _apiSpecificRenderWindow . setCursor ( cursorStyles . translateAxis ) ;
142
+ break ;
143
+ default :
144
+ model . _apiSpecificRenderWindow . setCursor ( cursorStyles . default ) ;
145
+ break ;
146
+ }
131
147
}
132
148
} ;
133
149
0 commit comments