Explorar el Código

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe hace 7 años
padre
commit
2a6d8be2d6
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      gui/src/controls/inputText.ts

+ 1 - 1
gui/src/controls/inputText.ts

@@ -380,7 +380,7 @@ module BABYLON.GUI {
                             this._cursorOffset++;
                             currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;
 
-                        } while (currentSize < absoluteCursorPosition);
+                        } while (currentSize < absoluteCursorPosition && (text.length >= this._cursorOffset));
 
                         // Find closest move
                         if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {