File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 11491149 _rafid = raf ( drawFrame ) ;
11501150 }
11511151 function drawFrame ( now ) {
1152- if ( _animated ) {
1153- _rafid = raf ( drawFrame ) ;
1154- }
11551152 let updated = 0 , frameTime = ( now - _lastFrameTime ) / 1e3 ;
11561153 _lastFrameTime = now ;
1157- if ( frameTime > _deltaTime * 30 ) {
1158- console . warn ( "skipping too long frame" ) ;
1159- } else {
1160- _accumulated += frameTime ;
1161- if ( ! _animated ) {
1162- _accumulated = _deltaTime ;
1154+ if ( _animated ) {
1155+ _rafid = raf ( drawFrame ) ;
1156+ if ( frameTime > 0.3 ) {
1157+ return console . warn ( "skipping too long frame" ) ;
11631158 }
1164- for ( ; _accumulated >= _deltaTime ; _accumulated -= _deltaTime ) {
1159+ _accumulated += frameTime ;
1160+ while ( _accumulated >= _deltaTime ) {
11651161 instance . emit ( "update" , _deltaTime * _timeScale ) ;
11661162 instance . setvar (
11671163 "ELAPSED" ,
11681164 instance . ELAPSED + _deltaTime * _timeScale
11691165 ) ;
11701166 updated ++ ;
1167+ _accumulated -= _deltaTime ;
11711168 }
1169+ } else {
1170+ updated = 1 ;
11721171 }
1173- if ( updated || ! _animated ) {
1172+ if ( updated ) {
11741173 instance . textalign ( "start" , "top" ) ;
11751174 instance . emit ( "draw" ) ;
11761175 }
Original file line number Diff line number Diff line change 11const cacheName = "luizbills.litecanvas-editor-v1" ;
2- const version = "2.78.0 " ;
2+ const version = "2.78.1 " ;
33
44const precacheResources = [
55 "/" ,
You can’t perform that action at this time.
0 commit comments