From e18fca76eff07bd94210ff50711c669bcfe33649 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 17 Feb 2023 11:36:05 -0700 Subject: [PATCH] [filterPen] Add current_pt --- Lib/fontTools/pens/filterPen.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/fontTools/pens/filterPen.py b/Lib/fontTools/pens/filterPen.py index 5417ae56d..81423109a 100644 --- a/Lib/fontTools/pens/filterPen.py +++ b/Lib/fontTools/pens/filterPen.py @@ -56,24 +56,31 @@ class FilterPen(_PassThruComponentsMixin, AbstractPen): def __init__(self, outPen): self._outPen = outPen + self.current_pt = None def moveTo(self, pt): self._outPen.moveTo(pt) + self.current_pt = pt def lineTo(self, pt): self._outPen.lineTo(pt) + self.current_pt = pt def curveTo(self, *points): self._outPen.curveTo(*points) + self.current_pt = points[-1] def qCurveTo(self, *points): self._outPen.qCurveTo(*points) + self.current_pt = points[-1] def closePath(self): self._outPen.closePath() + self.current_pt = None def endPath(self): self._outPen.endPath() + self.current_pt = None class ContourFilterPen(_PassThruComponentsMixin, RecordingPen):