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

feat: allow maintaining shape when dragging coordinates in select mode #188

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

JamesLMilner
Copy link
Owner

@JamesLMilner JamesLMilner commented Feb 5, 2024

Description of Changes

Provides a new option maintainShapeFrom in select mode in the feature -> coordinate property. The possible options are:

  • 'center' - the shape is maintained with it's origin at the center
  • 'opposite' - the shape is maintained with the origin as the opposite bounding box point

This is how you use it:

		new TerraDrawSelectMode({
			flags: {
				polygon: {
					feature: {
						draggable: true,
						rotateable: true,
						scaleable: true,
						coordinates: {
							midpoints: true,
							draggable: true,
							deletable: true,
							maintainShapeFrom: "center"
						},
					},
				},

This PR also fixes the fact that E2E tests were not actually running.

Link to Issue

#183 #184

PR Checklist

  • There is a associated GitHub issue
  • If I have added significant code changes, there are relevant tests
  • If there are behaviour changes these are documented

@JamesLMilner JamesLMilner force-pushed the select-maintain-shape branch 20 times, most recently from 7757680 to 864ab04 Compare February 7, 2024 18:57
@JamesLMilner JamesLMilner force-pushed the select-maintain-shape branch from 864ab04 to e6e84ea Compare February 7, 2024 19:00
@JamesLMilner JamesLMilner marked this pull request as ready for review February 7, 2024 19:27
@JamesLMilner JamesLMilner merged commit e1b88cc into main Feb 7, 2024
8 checks passed
Thunder7991 pushed a commit to Thunder7991/terra-draw that referenced this pull request Feb 11, 2024
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.

1 participant