Skip to content

Commit bed797f

Browse files
committed
fix: hide vertex picker preview when disabling it
1 parent 8ea4b4a commit bed797f

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/components",
33
"description": "Collection of core functionalities to author BIM apps.",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",

packages/core/src/core/Components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Components implements Disposable {
1414
/**
1515
* The version of the @thatopen/components library.
1616
*/
17-
static readonly release = "2.0.26";
17+
static readonly release = "2.1.1";
1818

1919
/** {@link Disposable.onDisposed} */
2020
readonly onDisposed = new Event<void>();

packages/core/src/utils/vertex-picker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ export class VertexPicker extends Component implements Disposable {
4949
*/
5050
readonly onVertexLost = new Event<THREE.Vector3>();
5151

52+
/**
53+
* An event that is triggered when the picker is enabled or disabled
54+
*/
55+
readonly onEnabled = new Event<boolean>();
56+
5257
/**
5358
* A reference to the Components instance associated with this VertexPicker.
5459
*/
@@ -79,6 +84,7 @@ export class VertexPicker extends Component implements Disposable {
7984
if (!value) {
8085
this._pickedPoint = null;
8186
}
87+
this.onEnabled.trigger(value);
8288
}
8389

8490
/**

packages/front/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/components-front",
33
"description": "Collection of frontend tools to author BIM apps.",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",

packages/front/src/utils/graphic-vertex-picker.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ export class GraphicVertexPicker
1717
/** The marker used to indicate the picked vertex. */
1818
marker: Mark | null = null;
1919

20+
constructor(
21+
components: OBC.Components,
22+
config?: Partial<OBC.VertexPickerConfig>,
23+
) {
24+
super(components, config);
25+
this.onEnabled.add((value: boolean) => {
26+
if (this.marker) {
27+
this.marker.visible = value;
28+
}
29+
});
30+
}
31+
2032
/** {@link OBC.Disposable.onDisposed} */
2133
dispose() {
2234
if (this.marker) {

0 commit comments

Comments
 (0)