コード例 #1
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// NewFrom returns a new Canvas from an existing vg.Canvas. vg.Canvas methods
// called on the Canvas will also be passed to the provided backing
// vg.Canvas. The Resolution field is set to the value returned by c.DPI.
func NewFrom(c vg.Canvas) *Canvas { return &Canvas{Resolution: c.DPI(), c: c} }
コード例 #2
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *DPI) ApplyTo(c vg.Canvas) {
	c.DPI()
}
コード例 #3
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Comment) ApplyTo(c vg.Canvas) {
	if c, ok := c.(Commenter); ok {
		c.Comment(a.Text)
	}
}
コード例 #4
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Fill) ApplyTo(c vg.Canvas) {
	c.Fill(a.Path)
}
コード例 #5
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *FillString) ApplyTo(c vg.Canvas) {
	c.FillString(a.fonts[fontID{name: a.Font, size: a.Size}], a.X, a.Y, a.String)
}
コード例 #6
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Pop) ApplyTo(c vg.Canvas) {
	c.Pop()
}
コード例 #7
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Stroke) ApplyTo(c vg.Canvas) {
	c.Stroke(a.Path)
}
コード例 #8
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Scale) ApplyTo(c vg.Canvas) {
	c.Scale(a.X, a.Y)
}
コード例 #9
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Push) ApplyTo(c vg.Canvas) {
	c.Push()
}
コード例 #10
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Translate) ApplyTo(c vg.Canvas) {
	c.Translate(a.X, a.Y)
}
コード例 #11
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *Rotate) ApplyTo(c vg.Canvas) {
	c.Rotate(a.Angle)
}
コード例 #12
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *SetColor) ApplyTo(c vg.Canvas) {
	c.SetColor(a.Color)
}
コード例 #13
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *SetLineDash) ApplyTo(c vg.Canvas) {
	c.SetLineDash(a.Dashes, a.Offsets)
}
コード例 #14
0
ファイル: recorder.go プロジェクト: sksullivan/plot
// ApplyTo applies the action to the given vg.Canvas.
func (a *SetLineWidth) ApplyTo(c vg.Canvas) {
	c.SetLineWidth(a.Width)
}