mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
use raf
This commit is contained in:
parent
4b08f1fbbe
commit
ed5c3979d3
@ -7,6 +7,7 @@ import createSceneData from '../d3/createSceneData.js';
|
||||
import createScene from '../d3/createScene.js';
|
||||
import injectSheet from 'react-jss';
|
||||
import ReactResizeDetector from 'react-resize-detector';
|
||||
import requestAnimationFrame from 'raf';
|
||||
|
||||
const styles = {
|
||||
container: {
|
||||
@ -62,7 +63,7 @@ class DoodlePreview extends React.Component {
|
||||
}
|
||||
|
||||
onResize = (width, height) => {
|
||||
window.requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
const { setSize, render } = this.state;
|
||||
const { pixelRatio } = this.props;
|
||||
setSize(width, height, pixelRatio);
|
||||
|
Loading…
Reference in New Issue
Block a user