public IEnumerator <object> Task() { while (true) { if (!SceneView.Instance.InputArea.IsMouseOverThisOrDescendant()) { yield return(null); continue; } var bone = Document.Current.SelectedNodes().Editable().OfType <Bone>().FirstOrDefault(); if (bone != null) { var entry = bone.Parent.AsWidget.BoneArray[bone.Index]; var t = Document.Current.Container.AsWidget.LocalToWorldTransform; var hull = BonePresenter.CalcRect(bone) * t; if (hull.Contains(sv.MousePosition) && !sv.Input.IsKeyPressed(Key.Control)) { Utils.ChangeCursorIfDefault(Cursors.Rotate); if (sv.Input.ConsumeKeyPress(Key.Mouse0)) { yield return(Rotate(bone, entry)); } } } yield return(null); } }
public IEnumerator <object> Task() { while (true) { var bone = Document.Current.SelectedNodes().Editable().OfType <Bone>().FirstOrDefault(); if (bone != null) { var entry = bone.Parent.AsWidget.BoneArray[bone.Index]; var t = Document.Current.Container.AsWidget.CalcTransitionToSpaceOf(sv.Scene); var hull = BonePresenter.CalcRect(bone) * t; if (hull.Contains(sv.MousePosition) && !sv.Input.IsKeyPressed(Key.Control)) { Utils.ChangeCursorIfDefault(Cursors.Rotate); if (sv.Input.ConsumeKeyPress(Key.Mouse0)) { yield return(Rotate(bone, entry)); } } } yield return(null); } }