Esempio n. 1
0
 /// <summary>
 /// Finish the movement on the core handle and if present also on the slave handle
 /// </summary>
 public void DragFinished(IInputModeContext context, PointD originalLocation, PointD newLocation)
 {
     coreHandle.DragFinished(context, originalLocation, newLocation);
     if (slaveHandle != null)
     {
         //If necessary, rotate the slave handle
         //Move the other one by the point reflection of our move delta, keeping its distance, though
         var delta = newLocation - middleLocation;
         //The distance of the slave handle - we keep this
         var otherDist = (slaveOrigin - middleLocation).VectorLength;
         slaveHandle.DragFinished(context, slaveOrigin, middleLocation - delta.Normalized * otherDist);
         CleanUp();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Finish the movement on the core handle and if present also on the slave handles
        /// </summary>
        public void DragFinished(IInputModeContext context, PointD originalLocation, PointD newLocation)
        {
            var delta = newLocation - originalLocation;

            coreHandle.DragFinished(context, originalLocation, newLocation);
            if (firstSlaveHandle != null)
            {
                firstSlaveHandle.DragFinished(context, firstOrigin, firstOrigin + delta);
            }
            if (lastSlaveHandle != null)
            {
                lastSlaveHandle.DragFinished(context, lastOrigin, lastOrigin + delta);
            }
            CleanUp();
        }