troika-three-text
Advanced tools
Comparing version 0.52.1 to 0.52.2
@@ -6,2 +6,14 @@ # Change Log | ||
## [0.52.2](https://github.com/protectwise/troika/compare/v0.52.1...v0.52.2) (2024-11-21) | ||
### Bug Fixes | ||
* **BatchedText:** Fix removing text instances ([8bf4bca](https://github.com/protectwise/troika/commit/8bf4bca24e0aa05c681f183edfaaca7620e2eefd)) | ||
* **BatchedText:** Fix texture memory leak ([908fe31](https://github.com/protectwise/troika/commit/908fe314233db7201aa72710b9ec2697158fee79)) | ||
## [0.52.1](https://github.com/protectwise/troika/compare/v0.52.0...v0.52.1) (2024-11-21) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "troika-three-text", | ||
"version": "0.52.1", | ||
"version": "0.52.2", | ||
"description": "SDF-based text rendering for Three.js", | ||
@@ -36,3 +36,3 @@ "author": "Jason Johnston <jason.johnston@protectwise.com>", | ||
}, | ||
"gitHead": "8e62c3421d6efc599b43d6d3aac31a7869774742" | ||
"gitHead": "1af247e61d2f9f884728a7c77914bc8255c4e7cb" | ||
} |
@@ -118,2 +118,3 @@ import { Text } from "./Text.js"; | ||
removeText (text) { | ||
this._needsRepack = true | ||
text.removeEventListener("synccomplete", this._onMemberSynced); | ||
@@ -169,3 +170,3 @@ this._members.delete(text); | ||
const width = Math.min(dataLength / 4, 1024); | ||
texture = this[isOutline ? 'outline' : 'main'] = new DataTexture( | ||
texture = this._dataTextures[isOutline ? 'outline' : 'main'] = new DataTexture( | ||
new Float32Array(dataLength), | ||
@@ -259,3 +260,4 @@ width, | ||
// Trigger sync on all members that need it | ||
let syncPromises; | ||
let syncPromises = this._needsRepack ? [] : null; | ||
this._needsRepack = false; | ||
this._members.forEach((packingInfo, text) => { | ||
@@ -262,0 +264,0 @@ if (packingInfo.dirty || text._needsSync) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
741310
12123