Esempio n. 1
0
        /// <summary>
        ///     Called after we draw the last servo in a group
        /// </summary>
        /// <param name="groupID">What Group was it</param>
        internal static void EndDrawGroup(int groupID)
        {
            if (Disabled)
            {
                return;           //If the Drag and Drop is Disabled then just go back
            }
            //Only do this if there is a group that contains Servos
            if (Groups.Count < 1 || Servos.Count < 1 || Servos.All(x => x.GroupID != groupID))
            {
                return;
            }

            try
            {
                //Set the height of the group to contain all the servos
                var newRect = new Rect(Groups[groupID].GroupRect)
                {
                    height = Servos.Last(x => x.GroupID == groupID).ServoRect.y +
                             Servos.Last(x => x.GroupID == groupID).ServoRect.height -
                             Groups[groupID].GroupRect.y
                };
                Groups[groupID].GroupRect = newRect;
            }
            catch (Exception ex) // Intentional Pokemon
            {
                Logger.Log(ex.Message, Logger.Level.Fatal);
            }
        }