Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Line tool #71

Merged
merged 1 commit into from Apr 13, 2021
Merged

Implement Line tool #71

merged 1 commit into from Apr 13, 2021

Conversation

edwin0cheng
Copy link
Contributor

@edwin0cheng edwin0cheng commented Apr 13, 2021

This PR implemented Line-Tool, which just default color of white for now, with some default thickness :

line_demo


This change is Reviewable

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @edwin0cheng)


core/document/src/lib.rs, line 25 at r1 (raw file):

stroke="white"

Could you please change this from stroke="white" to style="stroke: #fff;" for consistency? It'll be changed later, but it's used by a JavaScript hack which replaces #fff with random colors.


core/editor/src/tools/line.rs, line 54 at r1 (raw file):

				LineToolFsmState::Ready
			}

Nitpick: please delete this blank line between the two match arms. Thanks.


core/editor/src/tools/line.rs, line 57 at r1 (raw file):

			// TODO - Check for left mouse button
			(LineToolFsmState::LmbDown, Event::MouseUp(mouse_state)) => {
				let r = data.drag_start.distance(&mouse_state.position);

Let's rename r (which I assume came from the circle radius) to distance (and avoid single-character variable names in favor of expressiveness over shortness).

@edwin0cheng
Copy link
Contributor Author

Fixed !

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @edwin0cheng)

@Keavon Keavon merged commit 1fd298c into GraphiteEditor:master Apr 13, 2021
@edwin0cheng edwin0cheng deleted the line-tool branch April 13, 2021 05:36
Keavon pushed a commit that referenced this pull request Jul 30, 2023
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.

None yet

2 participants