@babylonjs/gui
Advanced tools
Comparing version 7.24.0 to 7.25.0
@@ -430,3 +430,3 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js"; | ||
if (this._cursorOffset === 0) { | ||
this.text = this._textWrapper.substr(0, this._textWrapper.length - 1); | ||
this.text = this._textWrapper.substring(0, this._textWrapper.length - 1); | ||
} | ||
@@ -433,0 +433,0 @@ else { |
@@ -292,3 +292,3 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js"; | ||
} | ||
const currentText = currentLine.text.substr(0, relativeIndex); | ||
const currentText = currentLine.text.substring(0, relativeIndex); | ||
const currentWidth = this._contextForBreakLines.measureText(currentText).width; | ||
@@ -304,3 +304,3 @@ let upperWidth = 0; | ||
previousWidth = Math.abs(currentWidth - upperWidth); | ||
upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width; | ||
upperWidth = this._contextForBreakLines.measureText(upperLine.text.substring(0, upperLineRelativeIndex)).width; | ||
} | ||
@@ -360,3 +360,3 @@ // Find closest move | ||
} | ||
const currentText = currentLine.text.substr(0, relativeIndex); | ||
const currentText = currentLine.text.substring(0, relativeIndex); | ||
const currentWidth = this._contextForBreakLines.measureText(currentText).width; | ||
@@ -371,3 +371,3 @@ let underWidth = 0; | ||
previousWidth = Math.abs(currentWidth - underWidth); | ||
underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width; | ||
underWidth = this._contextForBreakLines.measureText(underLine.text.substring(0, underLineRelativeIndex)).width; | ||
} | ||
@@ -733,3 +733,3 @@ // Find closest move | ||
if (!this._blinkIsEven || this._isTextHighlightOn) { | ||
let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width; | ||
let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substring(0, this._cursorInfo.relativeStartIndex)).width; | ||
if (cursorLeft < this._clipTextLeft) { | ||
@@ -786,3 +786,3 @@ this._scrollLeft += this._clipTextLeft - cursorLeft; | ||
const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length; | ||
const leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width; | ||
const leftOffsetWidth = context.measureText(line.text.substring(0, begin)).width; | ||
const selectedText = line.text.substring(begin, end); | ||
@@ -906,3 +906,3 @@ const hightlightWidth = context.measureText(selectedText).width; | ||
previousDist = Math.abs(relativeXPosition - currentSize); | ||
currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width; | ||
currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substring(0, relativeIndex)).width; | ||
} | ||
@@ -909,0 +909,0 @@ // Find closest move |
@@ -49,3 +49,3 @@ /** @internal */ | ||
} | ||
return this._text.substr(from, length); | ||
return this._text.substring(from, length ? length + from : undefined); | ||
} | ||
@@ -52,0 +52,0 @@ substring(from, to) { |
import { Tools } from "@babylonjs/core/Misc/tools.js"; | ||
import { Matrix, Vector3, TmpVectors } from "@babylonjs/core/Maths/math.vector.js"; | ||
import { Vector3 } from "@babylonjs/core/Maths/math.vector.js"; | ||
import { Container3D } from "./container3D.js"; | ||
@@ -85,3 +85,2 @@ /** | ||
let controlCount = 0; | ||
const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); | ||
// Measure | ||
@@ -94,9 +93,15 @@ for (const child of this._children) { | ||
child.mesh.computeWorldMatrix(true); | ||
// child.mesh.getWorldMatrix().multiplyToRef(currentInverseWorld, Tmp.Matrix[0]); | ||
const boundingBox = child.mesh.getHierarchyBoundingVectors(); | ||
const extendSize = TmpVectors.Vector3[0]; | ||
const diff = TmpVectors.Vector3[1]; | ||
boundingBox.max.subtractToRef(boundingBox.min, diff); | ||
diff.scaleInPlace(0.5); | ||
Vector3.TransformNormalToRef(diff, currentInverseWorld, extendSize); | ||
const extendSize = child.mesh.getBoundingInfo().boundingBox.extendSize; | ||
// to be safe, check descendants | ||
const descendants = child.mesh.getDescendants(false); | ||
for (const descendant of descendants) { | ||
descendant.computeWorldMatrix(true); | ||
const casted = descendant; | ||
if (typeof casted.getBoundingInfo === "function") { | ||
const extendSizeChild = casted.getBoundingInfo().boundingBox.extendSize; | ||
extendSize.x = Math.max(extendSize.x, extendSizeChild.x); | ||
extendSize.y = Math.max(extendSize.y, extendSizeChild.y); | ||
extendSize.z = Math.max(extendSize.z, extendSizeChild.z); | ||
} | ||
} | ||
this._cellWidth = Math.max(this._cellWidth, extendSize.x * 2); | ||
@@ -103,0 +108,0 @@ this._cellHeight = Math.max(this._cellHeight, extendSize.y * 2); |
{ | ||
"name": "@babylonjs/gui", | ||
"version": "7.24.0", | ||
"version": "7.25.0", | ||
"main": "index.js", | ||
@@ -16,3 +16,3 @@ "module": "index.js", | ||
"build": "npm run clean && npm run compile", | ||
"clean": "rimraf dist && rimraf *.tsbuildinfo && rimraf \"./**/*.!(md|json|build.json|lts.json)\"", | ||
"clean": "rimraf dist && rimraf *.tsbuildinfo -g && rimraf \"./**/*.!(md|json|build.json|lts.json)\" -g", | ||
"compile": "tsc -b tsconfig.build.json && tsc -b tsconfig.lts.json", | ||
@@ -22,3 +22,3 @@ "postcompile": "build-tools -c add-js-to-es6" | ||
"devDependencies": { | ||
"@babylonjs/core": "^7.24.0", | ||
"@babylonjs/core": "^7.25.0", | ||
"@dev/build-tools": "^1.0.0", | ||
@@ -25,0 +25,0 @@ "@lts/gui": "1.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3555309
36737