public RectAction(RectItem rect, SolidColorBrush originalColor, SolidColorBrush adaptedColor, long actionIndex) { Rect = rect; OriginalColor = originalColor; AdaptedColor = adaptedColor; ActionIndex = actionIndex; }
bool CanDraw(RectItem rect) { return _canDraw; }
public void AddSwatch() { RectItem rect = new RectItem(); rect.PixelColor = BrushManager.GetBrush(ColorPickerColor); if (!SwatchesContainsColor(rect.PixelColor)) { Swatches.Add(rect); OrderByColor(); } }
// ===== METHODS ===== public void EditRect(RectItem rec) { SolidColorBrush adaptionColor = BrushManager.GetBrush(ColorPickerColor); if (!rec.PixelColor.Color.Equals(adaptionColor.Color)) { _undoStack.Push(new RectAction(rec, rec.PixelColor, adaptionColor, _actionCounter > 0 ? _currentActionIndex - 1 : _currentActionIndex++)); rec.PixelColor = adaptionColor; _actionCounter++; } }