Pergunta

I'm trying to retrieve rotation value of currently selected cell, during and after rotation with handle.;

the cell "style" seems to hold the rotation value in its string but I did not find the way to retrieve it even with mxUtils.getValue(style, "rotation",0);

var cell = graph.getSelectionCell();
var preview = this.graphHandler;
// during mouse move
if (preview != null && preview.shape != null) {
  var angle = preview.shape.rotation; }
else {
  var angle  = mxUtils.toRadians(mxUtils.getValue(cell.getStyle(),mxConstants.STYLE_ROTATION, 0)); 
// var angle = cell.state.shape.getShapeRotation();  
} 

Any help would be helpful

Philippe

Foi útil?

Solução

Try mxUtils.getValue(graph.view.getState(cell).style,mxConstants.STYLE_ROTATION,0)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top