-
Notifications
You must be signed in to change notification settings - Fork 326
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
Conversation
* 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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to storeInitialCamera
packages/tools/src/synchronizers/callbacks/zoomPanSyncCallback.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/synchronizers/synchronizers/createCameraPositionSynchronizer.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/synchronizers/synchronizers/createZoomPanSynchronizer.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
e68a99a
to
014fff2
Compare
This feature adds a new zoom/pan sync option, with either setting being able to be turned off.