Skip to content

Implement SegmentPath.doreverse() and doflip()#106

Closed
leofernandezg wants to merge 1 commit intocdelker:masterfrom
leofernandezg:fix/segmentpath-reverse-flip
Closed

Implement SegmentPath.doreverse() and doflip()#106
leofernandezg wants to merge 1 commit intocdelker:masterfrom
leofernandezg:fix/segmentpath-reverse-flip

Conversation

@leofernandezg
Copy link
Copy Markdown

Summary

  • Implements SegmentPath.doreverse() and doflip() which were silent no-ops with commented-out code

Problem

Both methods had their implementations commented out, so elements containing SegmentPath segments would silently skip reverse/flip operations while other segment types (Segment, SegmentCircle, etc.) transformed correctly.

Changes

  • schemdraw/segments.py: Implemented both methods to handle the mixed Point/string path format, preserving SVG path commands while transforming coordinates
  • test/test_segmentpath.py: 5 tests verifying reverse, flip, coordinate changes, and string preservation

Test results

Branch Passed Failed
master 470 0
this branch 475 0

Fixes #102

These methods had commented-out implementations, making them silent
no-ops. Elements containing SegmentPath segments would silently skip
reverse/flip operations while other segment types transformed correctly.

Implemented both methods to handle the mixed Point/string path format,
preserving SVG path commands (strings) while transforming coordinates.
Added test/test_segmentpath.py.

Fixes cdelker#102
@cdelker cdelker closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SegmentPath.doreverse() and doflip() are silent no-ops

2 participants