同步框架

This commit is contained in:
joylink_zhaoerwei 2023-11-09 10:18:39 +08:00
parent 623f538399
commit 4bf4aa13d7
2 changed files with 9 additions and 3 deletions

View File

@ -943,8 +943,11 @@ abstract class GraphicSceneBase
/**
*
*/
selectAllGraphics() {
this.updateSelected(...this.queryStore.getAllGraphics());
selectAllGraphics(filter?: (g: JlGraphic) => boolean) {
if (filter == undefined) {
filter = (g) => g.visible;
}
this.updateSelected(...this.queryStore.getAllGraphics().filter(filter));
}
/**

View File

@ -386,7 +386,10 @@ export class CommonMouseTool extends AppInteractionPlugin {
const app = this.app;
const selects: JlGraphic[] = [];
app.queryStore.getAllGraphics().forEach((g) => {
if (!this.selectFilter || this.selectFilter(g)) {
if (
(this.selectFilter == undefined && g.visible) ||
(!!this.selectFilter && this.selectFilter(g))
) {
// 选择过滤器
if (g.boxIntersectCheck(boxRect)) {
selects.push(g);