Skip to content

Add BezPath.current_position() - #462

Merged
sagudev merged 3 commits into
linebender:mainfrom
sagudev:last_point
Jul 17, 2025
Merged

Add BezPath.current_position()#462
sagudev merged 3 commits into
linebender:mainfrom
sagudev:last_point

Conversation

@sagudev

@sagudev sagudev commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

Sometimes it is useful to obtain current position (sometimes also called last point/current point) of path. That's the one that also takes ClosePath into account. Implementation is very similar to PathEl.end_point, except that it handles close path.

Comment thread kurbo/src/bezpath.rs Outdated
Comment thread kurbo/src/bezpath.rs Outdated
@sagudev sagudev changed the title Add BezPath.last_point() Add BezPath.current_position() Jul 7, 2025
@sagudev

sagudev commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

I did all changes, improved docs and renamed to current_position as I think it's the most appropriate (in case you have more moves you have no points, but you have changing position of the pen).

@sagudev
sagudev requested a review from jneem July 7, 2025 15:05
Comment thread kurbo/src/bezpath.rs Outdated

@jneem jneem left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks fine to me now. Just a nitpick about the doc comment.

I think I actually liked the old name better, as "current" to me suggests state that is being modified over time. But this doesn't need to be blocked on naming.

@sagudev

sagudev commented Jul 8, 2025

Copy link
Copy Markdown
Contributor Author

Let's wait for another opinions.

For reference canvas spec uses last point, lyon_path has current_position and servo has current_point internally.

@sagudev

sagudev commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

If there will be no opposition I will land this as-is on Thursday.

sagudev and others added 2 commits July 17, 2025 09:48
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: jneem <joeneeman@gmail.com>
@sagudev

sagudev commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

rebased!

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev
sagudev added this pull request to the merge queue Jul 17, 2025
Merged via the queue into linebender:main with commit 1dd0dc5 Jul 17, 2025
15 checks passed
@sagudev
sagudev deleted the last_point branch July 17, 2025 07:53
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.

2 participants