27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
|
|
import type { ButtonConfig } from '../../../index.type';
|
|||
|
|
import type { BimEngine } from '../../../../../bim-engine';
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 选框放大按钮配置
|
|||
|
|
*
|
|||
|
|
* 说明:
|
|||
|
|
* - 当前仅添加 UI 按钮,点击事件先留空(后续接入引擎能力再实现)
|
|||
|
|
* - 使用工厂函数模式注入 engine,便于未来调用 engine API
|
|||
|
|
*/
|
|||
|
|
export const createZoomBoxButton = (_engine: BimEngine): ButtonConfig => {
|
|||
|
|
return {
|
|||
|
|
id: 'zoom-box',
|
|||
|
|
groupId: 'group-1',
|
|||
|
|
keepActive: true,
|
|||
|
|
type: 'button',
|
|||
|
|
label: 'toolbar.zoomBox',
|
|||
|
|
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 20q-1.875 0-3.187-1.312T12 15.5t1.313-3.187T16.5 11t3.188 1.313T21 15.5q0 .65-.187 1.25T20.3 17.9l2 2q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2-2q-.55.325-1.15.513T16.5 20m0-2q1.05 0 1.775-.725T19 15.5t-.725-1.775T16.5 13t-1.775.725T14 15.5t.725 1.775T16.5 18M4 18V9v1v-4zm0 2q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v3q0 .425-.288.713T21 10h-8V6H4v12h5q.425 0 .713.288T10 19t-.288.713T9 20z"/></svg>',
|
|||
|
|
onClick: () => {
|
|||
|
|
// 事件先留空:后续实现“框选放大/框选缩放”能力时再接入
|
|||
|
|
// 这里不做任何动作,避免误触影响用户操作
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|