MCPcopy Create free account
hub / github.com/esengine/esengine / markDirty

Method markDirty

packages/fairygui/src/text/DynamicFont.ts:334–347  ·  view source on GitHub ↗

* Mark a region as dirty * 标记区域为脏

(x: number, y: number, width: number, height: number)

Source from the content-addressed store, hash-verified

332 * 标记区域为脏
333 */
334 private markDirty(x: number, y: number, width: number, height: number): void {
335 this._dirty = true;
336
337 if (!this._dirtyRegion) {
338 this._dirtyRegion = { x, y, width, height };
339 } else {
340 const r = this._dirtyRegion;
341 const newX = Math.min(r.x, x);
342 const newY = Math.min(r.y, y);
343 const newWidth = Math.max(r.x + r.width, x + width) - newX;
344 const newHeight = Math.max(r.y + r.height, y + height) - newY;
345 this._dirtyRegion = { x: newX, y: newY, width: newWidth, height: newHeight };
346 }
347 }
348
349 /**
350 * Upload texture to GPU

Callers 1

renderCharacterMethod · 0.95

Calls 2

minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected