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: camera sync canvas relative #167

Merged
merged 7 commits into from
Aug 23, 2022
Merged

Conversation

wayfarer3130
Copy link
Collaborator

This feature adds a new zoom/pan sync option, with either setting being able to be turned off.

@wayfarer3130 wayfarer3130 requested a review from sedghi August 5, 2022 12:25
* to return [0,0] and 1 for the initial values.
* @param resetOffsets can be passed to skip resetting, ie a no-op on this call
*/
protected resetInitialOffsets(resetOffsets = true) {
Copy link
Member

Choose a reason for hiding this comment

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

The whole notion of resetInitialOffset does not make sense to me, this function just get the camera and set it as initialCamera. Shouldn't this function be like setInitialCamera? and then resetOffsets be like storeInitialCamera or something else? I don't understand what is being reset here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The idea is that it stores the initial camera, so I'm going to call it just that. Will push an update momentarily.

* Sets the canvas pan value relative to the initial view position of 0,0
* Modifies the camera to perform the pan.
*/
public setPan(pan: Point2, resetOffsets = false) {
Copy link
Member

Choose a reason for hiding this comment

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

again resetOffsets is confusing to me, I don't understand what it does. + function documentation miss arguments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed to storeInitialCamera

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

See my comments, main one is that resetOffsets is vauge and should be renamed to represent what it does which is setting initial camera. initial camera is also something that should be documented more of what it is. If you fix these minor comments we can merge. Thanks

@sedghi sedghi changed the title Feat/camera sync canvas relative feat: camera sync canvas relative Aug 9, 2022
@netlify
Copy link

netlify bot commented Aug 23, 2022

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 014fff2
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6304f2d5d05bf90008591c80
😎 Deploy Preview https://deploy-preview-167--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sedghi sedghi force-pushed the feat/cameraSync-canvas-relative branch from e68a99a to 014fff2 Compare August 23, 2022 15:31
@sedghi sedghi merged commit 2fd6c98 into main Aug 23, 2022
@sedghi sedghi deleted the feat/cameraSync-canvas-relative branch January 22, 2025 16:02
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.

3 participants