mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-23 03:23: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 createScene from '../d3/createScene.js';
|
||||||
import injectSheet from 'react-jss';
|
import injectSheet from 'react-jss';
|
||||||
import ReactResizeDetector from 'react-resize-detector';
|
import ReactResizeDetector from 'react-resize-detector';
|
||||||
|
import requestAnimationFrame from 'raf';
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
container: {
|
container: {
|
||||||
@ -62,7 +63,7 @@ class DoodlePreview extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onResize = (width, height) => {
|
onResize = (width, height) => {
|
||||||
window.requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
const { setSize, render } = this.state;
|
const { setSize, render } = this.state;
|
||||||
const { pixelRatio } = this.props;
|
const { pixelRatio } = this.props;
|
||||||
setSize(width, height, pixelRatio);
|
setSize(width, height, pixelRatio);
|
||||||
|
Loading…
Reference in New Issue
Block a user