private void RotateBlocks() { rotateTransform.Rotation = rotateTransformLambda(CalculateRotationAngle()); foreach (var textBlock in tagBlocks) { Point3D newPoint; if (rotateTransform.TryTransform(textBlock.CenterPoint, out newPoint)) { textBlock.CenterPoint = newPoint; if (TopItem == null || TopItem.CenterPoint.Z < newPoint.Z) { if (TopItem != null) { TopItem.SetAsTop(false); } TopItem = textBlock; TopItem.SetAsTop(true); } textBlock.Redraw(ActualWidth / 2, ActualHeight / 2); } } }
//=================================================================================================================== /// <summary> /// Rotate blocks /// </summary> private void RotateBlocks() { TagCloudItemSize size = GetElementsSize(); foreach (TagCloudItem TagCloudItem in tagCollection) { Point3D point3D; if (rotateTransform.TryTransform(TagCloudItem.CenterPoint, out point3D)) { TagCloudItem.CenterPoint = point3D; TagCloudItem.Redraw(size, scaleRatio, opacityRatio); } } }