-
Notifications
You must be signed in to change notification settings - Fork 220
Zoom Pulse Mode #40
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
Zoom Pulse Mode #40
Conversation
I should mention that I couldn't find a good place to clear the |
This has the risk of the zooming looking choppy even if the underlying rendering isn't, because of the timer being de-synchronized from the frames. Probably better to use |
demo/client/src/view.ts
Outdated
} | ||
let c = 0; | ||
let d = 0.005; | ||
this.pulseTimer = window.setInterval(() => { |
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.
Please use requestAnimationFrame()
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.
Will do.
@@ -306,6 +311,10 @@ export class PerspectiveCamera extends Camera { | |||
]); | |||
} | |||
|
|||
zoom(scale: number): void { |
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.
Why this change?
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.
I wanted to keep the old zoom
function private, but I needed something public that only took the scale
argument. So I renamed the private function to _zoom
and exposed the new function as zoom
.
@trishume good idea, I switched to RAFs in the latest patch. |
Works for me. |
Depends on #38
This PR adds a Zoom Pulse button to slowly zoom in and out the Text and SVG demo. The goal is to demonstrate how smooth rendering is.