增加可选配置--框选框的颜色
This commit is contained in:
parent
1e09b4c3c4
commit
897ed67ba4
@ -14,6 +14,10 @@ export interface IMouseToolOptions {
|
||||
* 是否启用框选,默认启用
|
||||
*/
|
||||
boxSelect?: boolean;
|
||||
/**
|
||||
* 框选框的颜色--默认黑色
|
||||
*/
|
||||
boxSelectColor?: string;
|
||||
/**
|
||||
* 是否启用视口拖拽(默认右键),默认启用
|
||||
*/
|
||||
@ -32,6 +36,7 @@ class CompleteMouseToolOptions implements IMouseToolOptions {
|
||||
boxSelect: boolean;
|
||||
viewportDrag: boolean;
|
||||
wheelZoom: boolean;
|
||||
boxSelectColor?: string;
|
||||
selectFilter?: GraphicSelectFilter | undefined;
|
||||
constructor() {
|
||||
this.boxSelect = true;
|
||||
@ -48,6 +53,7 @@ class CompleteMouseToolOptions implements IMouseToolOptions {
|
||||
if (options.wheelZoom != undefined) {
|
||||
this.wheelZoom = options.wheelZoom;
|
||||
}
|
||||
this.boxSelectColor = options.boxSelectColor;
|
||||
this.selectFilter = options.selectFilter;
|
||||
}
|
||||
}
|
||||
@ -287,7 +293,7 @@ export class CommonMouseTool extends AppInteractionPlugin {
|
||||
if (!this.drag) return;
|
||||
// 绘制框选矩形框
|
||||
this.box.clear();
|
||||
this.box.lineStyle({ width: 1, color: 0x000000 });
|
||||
this.box.lineStyle({ width: 1, color: this.options.boxSelectColor });
|
||||
const dsx = end.x - start.x;
|
||||
const dsy = end.y - start.y;
|
||||
let { x, y } = start;
|
||||
|
Loading…
Reference in New Issue
Block a user