Merge pull request #3345 from fonttools/recordingPen-draw

[RecordPen] Add draw() and drawPoints() as alias to replay()
This commit is contained in:
Cosimo Lupo 2023-11-20 10:14:47 +00:00 committed by GitHub
commit 638a16ceb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,6 +76,8 @@ class RecordingPen(AbstractPen):
def replay(self, pen): def replay(self, pen):
replayRecording(self.value, pen) replayRecording(self.value, pen)
draw = replay
class DecomposingRecordingPen(DecomposingPen, RecordingPen): class DecomposingRecordingPen(DecomposingPen, RecordingPen):
"""Same as RecordingPen, except that it doesn't keep components """Same as RecordingPen, except that it doesn't keep components
@ -167,6 +169,8 @@ class RecordingPointPen(AbstractPointPen):
for operator, args, kwargs in self.value: for operator, args, kwargs in self.value:
getattr(pointPen, operator)(*args, **kwargs) getattr(pointPen, operator)(*args, **kwargs)
drawPoints = replay
if __name__ == "__main__": if __name__ == "__main__":
pen = RecordingPen() pen = RecordingPen()