File tree 2 files changed +11
-12
lines changed
2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1149
1149
_rafid = raf ( drawFrame ) ;
1150
1150
}
1151
1151
function drawFrame ( now ) {
1152
- if ( _animated ) {
1153
- _rafid = raf ( drawFrame ) ;
1154
- }
1155
1152
let updated = 0 , frameTime = ( now - _lastFrameTime ) / 1e3 ;
1156
1153
_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" ) ;
1163
1158
}
1164
- for ( ; _accumulated >= _deltaTime ; _accumulated -= _deltaTime ) {
1159
+ _accumulated += frameTime ;
1160
+ while ( _accumulated >= _deltaTime ) {
1165
1161
instance . emit ( "update" , _deltaTime * _timeScale ) ;
1166
1162
instance . setvar (
1167
1163
"ELAPSED" ,
1168
1164
instance . ELAPSED + _deltaTime * _timeScale
1169
1165
) ;
1170
1166
updated ++ ;
1167
+ _accumulated -= _deltaTime ;
1171
1168
}
1169
+ } else {
1170
+ updated = 1 ;
1172
1171
}
1173
- if ( updated || ! _animated ) {
1172
+ if ( updated ) {
1174
1173
instance . textalign ( "start" , "top" ) ;
1175
1174
instance . emit ( "draw" ) ;
1176
1175
}
Original file line number Diff line number Diff line change 1
1
const cacheName = "luizbills.litecanvas-editor-v1" ;
2
- const version = "2.78.0 " ;
2
+ const version = "2.78.1 " ;
3
3
4
4
const precacheResources = [
5
5
"/" ,
You can’t perform that action at this time.
0 commit comments