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

rings: remove Lens type #14

Merged
merged 1 commit into from
Aug 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions plotter/rings/angles.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,3 @@ func (a Arcs) containingArcOf(f Feature) (Arc, bool) {
}
return arcNaN, false
}

// Lens is an ArcOfer that can arbitrarily scale the arc of a feature.
type Lens struct {
ArcOfer

// Optics is a contextual arc scaling function.
Optics func(loc, f Feature, base, arc Arc) (Arc, error)
}

// ArcOf returns a scaled arc determined by a call to the Optics function using the
// arc returned by the embedded ArcOfer's ArcOf method.
func (l Lens) ArcOf(loc, f Feature) (Arc, error) {
arc, err := l.ArcOfer.ArcOf(loc, f)
if err != nil {
return arc, err
}
return l.Optics(loc, f, l.ArcOfer.Arc(), arc)
}