框选、全选添加默认过滤不可见图形
This commit is contained in:
parent
3fe8f895fa
commit
0338431267
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user