Ejemplo n.º 1
0
        private void updatePreview(int vectorIndex, VectorAction action, PictureBox box)
        {
            if (vectorIndex < 0 || vectorIndex >= vectors.Count || vectors.Count == 0)
            {
                return;
            }

            SVG                 temp        = Editor.svgFromDataFactory(vectors[vectorIndex].data);
            List <SVG>          tempVectors = new List <SVG>();
            List <VectorAction> tempActions = new List <VectorAction>();

            tempVectors.Add(temp);

            if (action != null)
            {
                tempActions.Add(action);
            }

            tempActions.AddRange(actions);

            Editor.refreshActions(tempActions);
            Editor.assignAllActions(tempVectors, tempActions);
            Editor.doActions(tempVectors);

            drawPreview(tempVectors[0], svgPreview);
        }
Ejemplo n.º 2
0
        private void createUpdatePreview(Color oldColor, Color newColor)
        {
            if (oldColor == Color.Transparent || newColor == Color.Transparent)
            {
                return;
            }

            VectorAction action = Editor.actionFactory(oldColor, newColor);

            updatePreview(selectedVector, action, svgPreview);
        }
Ejemplo n.º 3
0
            public bool addAction(VectorAction newAction)
            {
                if (newAction != null)
                {
                    VectorAction dummy = new VectorAction(newAction.oldColor, newAction.newColor);

                    actions.Add(dummy);
                    _actionCount = actions.Count;

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
Ejemplo n.º 4
0
            public static bool assignAction(List <SVG> vectors, VectorAction action)
            {
                if (vectors == null || action == null)
                {
                    return(false);
                }

                masterGarbageDispose(vectors);

                foreach (SVG vector in vectors)
                {
                    if (!vector.actionExists(action))
                    {
                        vector.addAction(action);
                    }
                }

                return(true);
            }
Ejemplo n.º 5
0
            public bool actionExists(VectorAction action)
            {
                if (action == null)
                {
                    return(false);
                }

                garbageDispose();

                foreach (VectorAction a in actions)
                {
                    if (a.newColor.Equals(action.newColor) && a.oldColor.Equals(action.oldColor))
                    {
                        return(true);
                    }
                }

                return(false);
            }