File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ def _wait(cvs): # wait for an event
392392 cvs ._waitfor = None
393393 if _isnotebook : baseObj .trigger () # in notebook environment must send methods immediately
394394 while cvs ._waitfor is None :
395- rate (30 )
395+ rate (100 )
396396 return cvs ._waitfor
397397
398398class color (object ):
Original file line number Diff line number Diff line change @@ -118,16 +118,18 @@ function checkloading() {
118118function domessage ( msg ) {
119119 "use strict" ;
120120 if ( timer !== null ) clearTimeout ( timer )
121- var t1 = msclock ( )
121+ var t1 = msclock ( )
122122 var data = msg . content . data
123123 if ( data != 'trigger' ) {
124124 var msg = decode ( data )
125125 handler ( msg )
126- }
127- var t2 = msclock ( )
128- var dt = Math . floor ( t1 + interval - t2 ) // attempt to keep the time between renders constant
129- if ( dt < 15 ) dt = 0 // becaause setTimeout is inaccurate for small dt's
130- timer = setTimeout ( send , dt )
126+ }
127+ if ( timer !== null ) { // if not a wait situation as with compound/extrusion/text
128+ var t2 = msclock ( )
129+ var dt = Math . floor ( t1 + interval - t2 ) // attempt to keep the time between renders constant
130+ if ( dt < 15 ) dt = 0 // becaause setTimeout is inaccurate for small dt's
131+ timer = setTimeout ( send , dt )
132+ }
131133}
132134
133135// vpython.py calls onmessage, which responds through domessage, using send
@@ -148,7 +150,7 @@ function onmessage(msg) {
148150if ( timer !== undefined && timer !== null ) clearTimeout ( timer )
149151
150152function send ( ) { // periodically send events and update_canvas and request object update
151- "use strict" ;
153+ "use strict" ;
152154 var update = update_canvas ( )
153155 if ( update !== null ) events = events . concat ( update )
154156 if ( events . length === 0 ) events = [ { event :'update_canvas' , 'trigger' :1 } ]
You can’t perform that action at this time.
0 commit comments