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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top