// Copyright ©2020 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package vg

import (
	
	

	
)

// MultiCanvas creates a canvas that duplicates its drawing operations to all
// the provided canvases, similar to the Unix tee(1) command.
//
// Each drawing operation is sent to each listed canvas, one at a time.
func ( ...Canvas) Canvas {
	return teeCanvas{}
}

type teeCanvas struct {
	cs []Canvas
}

// SetLineWidth sets the width of stroked paths.
// If the width is not positive then stroked lines
// are not drawn.
func ( teeCanvas) ( Length) {
	for ,  := range .cs {
		.SetLineWidth()
	}
}

// SetLineDash sets the dash pattern for lines.
// The pattern slice specifies the lengths of
// alternating dashes and gaps, and the offset
// specifies the distance into the dash pattern
// to start the dash.
func ( teeCanvas) ( []Length,  Length) {
	for ,  := range .cs {
		.SetLineDash(, )
	}
}

// SetColor sets the current drawing color.
// Note that fill color and stroke color are
// the same, so if you want different fill
// and stroke colors then you must set a color,
// draw fills, set a new color and then draw lines.
func ( teeCanvas) ( color.Color) {
	for ,  := range .cs {
		.SetColor()
	}
}

// Rotate applies a rotation transform to the context.
// The parameter is specified in radians.
func ( teeCanvas) ( float64) {
	for ,  := range .cs {
		.Rotate()
	}
}

// Translate applies a translational transform to the context.
func ( teeCanvas) ( Point) {
	for ,  := range .cs {
		.Translate()
	}
}

// Scale applies a scaling transform to the context.
func ( teeCanvas) (,  float64) {
	for ,  := range .cs {
		.Scale(, )
	}
}

// Push saves the current line width, the
// current dash pattern, the current
// transforms, and the current color
// onto a stack so that the state can later
// be restored by calling Pop().
func ( teeCanvas) () {
	for ,  := range .cs {
		.Push()
	}
}

// Pop restores the context saved by the
// corresponding call to Push().
func ( teeCanvas) () {
	for ,  := range .cs {
		.Pop()
	}
}

// Stroke strokes the given path.
func ( teeCanvas) ( Path) {
	for ,  := range .cs {
		.Stroke()
	}
}

// Fill fills the given path.
func ( teeCanvas) ( Path) {
	for ,  := range .cs {
		.Fill()
	}
}

// FillString fills in text at the specified
// location using the given font.
// If the font size is zero, the text is not drawn.
func ( teeCanvas) ( font.Face,  Point,  string) {
	for ,  := range .cs {
		.FillString(, , )
	}
}

// DrawImage draws the image, scaled to fit
// the destination rectangle.
func ( teeCanvas) ( Rectangle,  image.Image) {
	for ,  := range .cs {
		.DrawImage(, )
	}
}

var _ Canvas = (*teeCanvas)(nil)