public void Item_TouchDown(PointF p, ObjectInfo objInfo) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); IsSelecting = true; fileBoxObject = new FileBoxObject(window, main, objInfo); main.Children.Add(fileBoxObject); fileBoxObject.setPosition(globalPt, thisAngle + thisCont.RotateFilter.Target); }
public void Item_TouchMove(PointF p, int state) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); if (IsSelecting == true) { if (state == 1) { fileBoxObject.img_send.Visibility = Visibility.Visible; } else { fileBoxObject.img_send.Visibility = Visibility.Hidden; } fileBoxObject.setPosition(globalPt, thisAngle + thisCont.RotateFilter.Target); } else if (IsMoving == true) { thisCont.SetPosition(globalPt.X - ((float)fileBoxCon.Width / 2) + (float)bt_move.Width, globalPt.Y - ((float)fileBoxCon.Height / 2) + (float)bt_move.Height, thisAngle + thisCont.RotateFilter.Target, 1.0); } else if (IsRotating == true) { // System.Windows.Point tmpt = bt_rotate.TransformToAncestor(window).Transform(new System.Windows.Point(0, 0)); // CenterPoint.X = (float)tmpt.X + (float)(bt_rotate.Width / 2); // CenterPoint.Y = (float)tmpt.Y + (float)(bt_rotate.Height / 2); // // PointF DistanceVector = new PointF((globalPt.X - CenterPoint.X), (CenterPoint.Y - globalPt.Y)); // // double CurrentAngle = Math.Atan2(DistanceVector.Y, DistanceVector.X) * (180 / Math.PI); // // if (!firstAng) // { // // 처음 각도 // thisAngle = CurrentAngle + rotateTrans.Angle; // firstAng = true; // } // // 현재 각도 // double AngleDiff = (thisAngle - CurrentAngle + 360) % 360; // rotateTrans.Angle = AngleDiff; // // //fileBoxCon.RenderTransform = rotateTrans; // thisCont.SetPosition(CenterPoint.X, CenterPoint.Y, // AngleDiff, 1.0); // //thisCont.RotateFileBox(AngleDiff, globalPt, CenterPoint); } }
public void Item_TouchDown(PointF p, ObjectInfo objInfo) { //절대 좌표로 변경 PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y); IsSelecting = true; fileBoxObject = new FileBoxObject(window, main, objInfo); main.Children.Add(fileBoxObject); fileBoxObject.setPosition(globalPt, thisAngle + thisCont.RotateFilter.Target); }