refactor(ui): move UIBatchSorter from core to ui

UIBatchSorter is only used by UICanvas; keeping it in core forced a
cross-package export plus a ts-ignore at the UICanvas import site for
an @internal symbol. Move it next to its sole consumer in the ui
package and add RenderElement to core's RenderPipeline barrel so ui
can type the sort input. Utils._quickSort stays @internal; the new
call site carries a single ts-ignore acknowledging the reuse.
This commit is contained in:
chenmo.gl
2026-05-12 17:40:20 +08:00
parent 41bca94452
commit 7ac1913bad
4 changed files with 6 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
export { BasicRenderPipeline, RenderQueueFlags } from "./BasicRenderPipeline";
export { VertexMergeBatcher } from "./VertexMergeBatcher";
export { UIBatchSorter } from "./UIBatchSorter";
export { Blitter } from "./Blitter";
export { RenderElement } from "./RenderElement";
export { RenderQueue } from "./RenderQueue";
export { PipelineStage } from "./enums/PipelineStage";

View File

@@ -1,6 +1,4 @@
import { BoundingBox, Matrix } from "@galacean/engine-math";
import { Utils } from "../Utils";
import { RenderElement } from "./RenderElement";
import { BoundingBox, Matrix, RenderElement, Utils } from "@galacean/engine";
/**
* @internal
@@ -118,6 +116,7 @@ export class UIBatchSorter {
}
}
// @ts-ignore — Utils._quickSort is @internal
Utils._quickSort(entries, 0, count, UIBatchSorter._compareEntries);
for (let i = 0; i < count; i++) elements[i] = entries[i].element;
}

View File

@@ -16,11 +16,10 @@ import {
assignmentClone,
deepClone,
dependentComponents,
ignoreClone,
// @ts-ignore — internal API
UIBatchSorter
ignoreClone
} from "@galacean/engine";
import { Utils } from "../Utils";
import { UIBatchSorter } from "./UIBatchSorter";
import { CanvasRenderMode } from "../enums/CanvasRenderMode";
import { ResolutionAdaptationMode } from "../enums/ResolutionAdaptationMode";
import { UIHitResult } from "../input/UIHitResult";

View File

@@ -1,4 +1,4 @@
import { UIBatchSorter } from "@galacean/engine-core";
import { UIBatchSorter } from "@galacean/engine-ui/src/component/UIBatchSorter";
import { BoundingBox, Matrix, Quaternion, Vector3 } from "@galacean/engine-math";
import { describe, expect, it } from "vitest";