Browse Source

bind lexical this for this.update (#28357)

ycw 1 year ago
parent
commit
86a4d25640
1 changed files with 2 additions and 4 deletions
  1. 2 4
      editor/js/libs/ui.three.js

+ 2 - 4
editor/js/libs/ui.three.js

@@ -549,9 +549,7 @@ class UIPoints extends UISpan {
 		this.lastPointIdx = 0;
 		this.onChangeCallback = null;
 
-		// TODO Remove this bind() stuff
-
-		this.update = function () {
+		this.update = () => { // bind lexical this
 
 			if ( this.onChangeCallback !== null ) {
 
@@ -559,7 +557,7 @@ class UIPoints extends UISpan {
 
 			}
 
-		}.bind( this );
+		};
 
 	}