Skip to content

Add Gradient tool test for double clicking to insert a gradient stop #2527

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

Sidharth-Singh10
Copy link
Contributor

Closes part of #2488

@Sidharth-Singh10
Copy link
Contributor Author

@0HyperCube, could you please review the flow of code once?
This is my first time here writing tests.

I included a check for whether if the stop was inserted at the correct position,

let positions: Vec<f64> = updated_gradient.stops.iter().map(|(pos, _)| *pos).collect();
		assert!(
			positions.iter().any(|pos| (pos - 0.5).abs() < 0.1),
			"Expected to find a stop near position 0.5, but found: {:?}",
			positions
		);

but it may not be necessary as the test is just for check for insertion of gradient stop

@Sidharth-Singh10 Sidharth-Singh10 marked this pull request as ready for review April 7, 2025 13:34
@Keavon Keavon changed the title gradient tool test: Double click to insert a gradient stop Add test for Gradient tool for double clicking to insert a gradient stop Apr 9, 2025
@Keavon Keavon changed the title Add test for Gradient tool for double clicking to insert a gradient stop Add Gradient tool test for double clicking to insert a gradient stop Apr 9, 2025
Copy link
Member

@0HyperCube 0HyperCube left a comment

Choose a reason for hiding this comment

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

Looks good; thanks for this contribution.

@0HyperCube 0HyperCube enabled auto-merge (squash) April 11, 2025 14:17
@0HyperCube 0HyperCube disabled auto-merge April 11, 2025 14:22
@0HyperCube 0HyperCube enabled auto-merge (squash) April 11, 2025 14:23
@0HyperCube 0HyperCube merged commit e4d998a into GraphiteEditor:master Apr 11, 2025
4 checks passed
@Keavon Keavon mentioned this pull request Apr 11, 2025
6 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants