@@ -103,17 +103,13 @@ class ServicesCanvas extends Base {
103103 }
104104
105105 static config = {
106- /**
107- * @member {String} className='Portal.canvas.ServicesCanvas'
108- * @protected
109- */
110- className : 'Portal.canvas.ServicesCanvas' ,
111- /**
112- * @member {Number|null} animationId_=null
113- */
114- animationId_ : null ,
115- /**
116- * Remote method access for the App Worker.
106+ /**
107+ * @member {String} className='Portal.canvas.ServicesCanvas'
108+ * @protected
109+ */
110+ className : 'Portal.canvas.ServicesCanvas' ,
111+ /**
112+ * Remote method access for the App Worker.
117113 * Allows the UI (Controller) to control the simulation state and input.
118114 * @member {Object} remote
119115 * @protected
@@ -143,6 +139,10 @@ class ServicesCanvas extends Base {
143139 theme_ : 'light'
144140 }
145141
142+ /**
143+ * @member {Number|null} animationId=null
144+ */
145+ animationId = null
146146 /**
147147 * ID of the canvas element in the DOM.
148148 * @member {String|null} canvasId=null
@@ -238,21 +238,6 @@ class ServicesCanvas extends Base {
238238 */
239239 rotation = { x : - 0.4 , y : 0 } // Base tilt (radians) - Floor Perspective
240240
241- /**
242- * Triggered after the animationId config got changed
243- * @param {Number|null } value
244- * @param {Number|null } oldValue
245- */
246- afterSetAnimationId ( value , oldValue ) {
247- if ( oldValue ) {
248- if ( hasRaf ) {
249- cancelAnimationFrame ( oldValue )
250- } else {
251- clearTimeout ( oldValue )
252- }
253- }
254- }
255-
256241 /**
257242 * Clears the graph state and stops the render loop.
258243 * Used when the component is destroyed or the route changes to release memory.
@@ -707,7 +692,9 @@ class ServicesCanvas extends Base {
707692 if ( canvas ) {
708693 me . context = canvas . getContext ( '2d' ) ;
709694 me . updateSize ( { width : canvas . width , height : canvas . height } ) ;
710- hasChange && me . renderLoop ( )
695+ if ( hasChange && ! me . animationId ) {
696+ me . renderLoop ( )
697+ }
711698 } else {
712699 setTimeout ( checkCanvas , 50 )
713700 }
0 commit comments