Remove LineNoMarker

This commit is contained in:
Laurent Le Goff 2015-04-23 17:14:16 +02:00
parent 42d0eb260f
commit 5df1705bb4
3 changed files with 1 additions and 8 deletions

View file

@ -27,7 +27,6 @@ func (dasher *DashVertexConverter) NextCommand(cmd LineMarker) {
func (dasher *DashVertexConverter) LineTo(x, y float64) { func (dasher *DashVertexConverter) LineTo(x, y float64) {
dasher.lineTo(x, y) dasher.lineTo(x, y)
dasher.command = LineNoneMarker
} }
func (dasher *DashVertexConverter) MoveTo(x, y float64) { func (dasher *DashVertexConverter) MoveTo(x, y float64) {

View file

@ -6,9 +6,8 @@ package draw2d
type LineMarker byte type LineMarker byte
const ( const (
LineNoneMarker LineMarker = iota
// Mark the current point of the line as a join to it can draw some specific join Bevel, Miter, Rount // Mark the current point of the line as a join to it can draw some specific join Bevel, Miter, Rount
LineJoinMarker LineJoinMarker LineMarker = iota
) )
type LineBuilder interface { type LineBuilder interface {

View file

@ -38,7 +38,6 @@ func NewLineStroker(c Cap, j Join, converter LineBuilder) *LineStroker {
l.rewind = make([]float64, 0, 256) l.rewind = make([]float64, 0, 256)
l.Cap = c l.Cap = c
l.Join = j l.Join = j
l.command = LineNoneMarker
return l return l
} }
@ -51,15 +50,12 @@ func (l *LineStroker) End() {
l.Next.MoveTo(l.vertices[0], l.vertices[1]) l.Next.MoveTo(l.vertices[0], l.vertices[1])
for i, j := 2, 3; j < len(l.vertices); i, j = i+2, j+2 { for i, j := 2, 3; j < len(l.vertices); i, j = i+2, j+2 {
l.Next.LineTo(l.vertices[i], l.vertices[j]) l.Next.LineTo(l.vertices[i], l.vertices[j])
l.Next.NextCommand(LineNoneMarker)
} }
} }
for i, j := len(l.rewind)-2, len(l.rewind)-1; j > 0; i, j = i-2, j-2 { for i, j := len(l.rewind)-2, len(l.rewind)-1; j > 0; i, j = i-2, j-2 {
l.Next.NextCommand(LineNoneMarker)
l.Next.LineTo(l.rewind[i], l.rewind[j]) l.Next.LineTo(l.rewind[i], l.rewind[j])
} }
if len(l.vertices) > 1 { if len(l.vertices) > 1 {
l.Next.NextCommand(LineNoneMarker)
l.Next.LineTo(l.vertices[0], l.vertices[1]) l.Next.LineTo(l.vertices[0], l.vertices[1])
} }
l.Next.End() l.Next.End()
@ -85,7 +81,6 @@ func (l *LineStroker) LineTo(x, y float64) {
default: default:
l.line(l.x, l.y, x, y) l.line(l.x, l.y, x, y)
} }
l.command = LineNoneMarker
} }
func (l *LineStroker) Close() { func (l *LineStroker) Close() {