diff --git a/pkg/point/extend_point.go b/pkg/point/extend_point.go index 70a5e25..caf476d 100644 --- a/pkg/point/extend_point.go +++ b/pkg/point/extend_point.go @@ -52,8 +52,9 @@ func (b *ExtendPoint) Vector() vector.Vector { // Matrix calculates and returns the [canvas.Matrix] of a point. func (b *ExtendPoint) Matrix() canvas.Matrix { - return b.to.Matrix().Translate(b.extendedVector().Values()). - Rotate((b.from.Vector().AngleBetween(b.to.Vector()) - math.Pi/2) * 180 / math.Pi) + return canvas.Identity.Translate(b.Position().Vector.Values()).Rotate(b.Position().RotationD()) + //return b.to.Matrix().Translate(b.extendedVector().Values()). + // Rotate((b.from.Vector().AngleBetween(b.to.Vector()) - math.Pi/2) * 180 / math.Pi) } // ID returns the point ID. diff --git a/pkg/point/point.go b/pkg/point/point.go index 3cf0dee..0e03e1f 100644 --- a/pkg/point/point.go +++ b/pkg/point/point.go @@ -53,7 +53,7 @@ func Draw(c *canvas.Canvas, point Point, face *canvas.FontFace, debug bool) { c.RenderPath(path, style, m) text := canvas.NewTextLine(face, point.Name(), canvas.Bottom) - c.RenderText(text, m.Translate(2, -4)) + c.RenderText(text, m.Translate(2, -4).Rotate(-point.Position().RotationD())) if debug { yStyle := canvas.Style{