Changeset 8397


Ignore:
Timestamp:
Sep 28, 2019, 5:38:27 PM (2 years ago)
Author:
Sven Rech
Message:

WorkspaceManager: Use line adjustment mechanism also for all dragged line which were not modified manually.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/View/VisualComponents/CryptoLineView/CryptoLineView.xaml.cs

    r8385 r8397  
    765765            if (!IsEditingPoint)
    766766            {
    767                 if (HasManualModification)
     767                bool hasBeenAdjusted = false;
     768                if (HasManualModification || IsDragged)
    768769                {
    769770                    //Keep manually modified connections "as is", but adjust start and end point if necessary:
    770                     if (!AdjustManuallyModifiedLine(PointList, StartPoint, EndPoint))
     771                    hasBeenAdjusted = AdjustLine(PointList, StartPoint, EndPoint);
     772                    if (!hasBeenAdjusted && HasManualModification)
    771773                    {
    772774                        //Adjustment of manually modified line failed, so switch back to "automatic mode":
     
    775777                }
    776778
    777                 if (!HasManualModification)
     779                if (!hasBeenAdjusted)
    778780                {
    779781                    bool failed = false;
     
    869871
    870872        /// <summary>
    871         /// Adjusts only start and end points of an already existing path which was modified manually.
     873        /// Adjusts only start and end points of an already existing line path.
    872874        /// </summary>
    873875        /// <param name="segments">The segments of the old line.</param>
     
    875877        /// <param name="newEndPoint">The new end point to adjust to.</param>
    876878        /// <returns>Whether adjustment was possible.</returns>
    877         private static bool AdjustManuallyModifiedLine(IEnumerable<FromTo> segments, Point newStartPoint, Point newEndPoint)
     879        private static bool AdjustLine(IEnumerable<FromTo> segments, Point newStartPoint, Point newEndPoint)
    878880        {
    879881            //Zip segment lists to create adjacent segments:
Note: See TracChangeset for help on using the changeset viewer.