예제 #1
0
        /// <summary>
        /// Remove selected keys.
        /// </summary>
        public void RemoveKeys()
        {
            if (!Editable)
            {
                return;
            }

            if (selectedKeys.Count != 0)
            {
                // Generate Remove keys command and execute it.
                EditCurveKeyAddRemoveCommand command =
                    new EditCurveKeyAddRemoveCommand(this, selectedKeys.Values);

                command.Execute();
                if (commandHistory != null)
                {
                    commandHistory.Add(command);
                }

                // Clear selection
                selection.Clear();
                selectedKeys.Clear();

                dirty = true;
            }
        }
예제 #2
0
        /// <summary>
        /// Add new key at given position.
        /// </summary>
        /// <param name="pos"></param>
        public void AddKey(Vector2 pos)
        {
            EnsureUpdating("AddKey");

            // Create new key.
            EditCurveKey key = new EditCurveKey(EditCurveKey.GenerateUniqueId(),
                                                new CurveKey(pos.X, pos.Y));

            key.Selection = EditCurveSelections.Key;

            // Generate add key command and execute it.
            EditCurveKeyAddRemoveCommand command =
                new EditCurveKeyAddRemoveCommand(this, key, selection);

            command.Execute();
            if (commandHistory != null)
            {
                commandHistory.Add(command);
            }
        }
예제 #3
0
        /// <summary>
        /// Remove selected keys.
        /// </summary>
        public void RemoveKeys()
        {
            if (!Editable) return;

            if (selectedKeys.Count != 0)
            {
                // Generate Remove keys command and execute it.
                EditCurveKeyAddRemoveCommand command =
                    new EditCurveKeyAddRemoveCommand(this, selectedKeys.Values);

                command.Execute();
                if (commandHistory != null) commandHistory.Add(command);

                // Clear selection
                selection.Clear();
                selectedKeys.Clear();

                dirty = true;
            }
        }
예제 #4
0
        /// <summary>
        /// Add new key at given position.
        /// </summary>
        /// <param name="pos"></param>
        public void AddKey(Vector2 pos)
        {
            EnsureUpdating("AddKey");

            // Create new key.
            EditCurveKey key = new EditCurveKey(EditCurveKey.GenerateUniqueId(),
                                                    new CurveKey(pos.X, pos.Y));
            key.Selection = EditCurveSelections.Key;

            // Generate add key command and execute it.
            EditCurveKeyAddRemoveCommand command =
                new EditCurveKeyAddRemoveCommand(this, key, selection);

            command.Execute();
            if (commandHistory != null) commandHistory.Add(command);
        }