Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vg/recorder: drop unneeded field from Canvas. #772

Merged
merged 2 commits into from Sep 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions vg/recorder/recorder.go
Expand Up @@ -32,11 +32,6 @@ type Canvas struct {
// This includes source filename and line number.
KeepCaller bool

// c holds a backing vg.Canvas. If c is non-nil
// then method calls to the Canvas will be
// reflected to c.
c vg.Canvas

// fonts holds a collection of font/size descriptions.
fonts map[fontID]font.Face
cache *font.Cache
Expand Down Expand Up @@ -78,7 +73,7 @@ func (c *Canvas) Reset() {
c.Actions = c.Actions[:0]
}

// ReplayOn applies the set of Actions recorded by the Recorder onto
// ReplayOn applies the set of Actions recorded by the Canvas onto
// the destination Canvas.
func (c *Canvas) ReplayOn(dst vg.Canvas) error {
if c.fonts == nil {
Expand Down Expand Up @@ -112,9 +107,6 @@ func (c *Canvas) ReplayOn(dst vg.Canvas) error {
}

func (c *Canvas) append(a Action) {
if c.c != nil {
a.ApplyTo(c)
}
if c.KeepCaller {
a.callerLocation().set()
}
Expand Down Expand Up @@ -460,7 +452,7 @@ type Commenter interface {

var _ Commenter = (*Canvas)(nil)

// Comment implements a Recorder comment mechanism.
// Comment implements a comment mechanism.
type Comment struct {
Text string

Expand Down