mirror of
https://github.com/galacean/engine.git
synced 2026-06-05 02:44:47 +08:00
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:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user