File tree Expand file tree Collapse file tree 6 files changed +45
-2
lines changed
src/components/tools/MeasurementTools/svg Expand file tree Collapse file tree 6 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ export default {
97
97
mounted () {
98
98
this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
99
99
this .updateLabels ();
100
+ this .resizeObserver = new ResizeObserver (() => {
101
+ this .updatePoints ();
102
+ });
103
+ this .resizeObserver .observe (this .view .getContainer ());
104
+ },
105
+ beforeUnmount () {
106
+ this .resizeObserver .disconnect ();
100
107
},
101
108
methods: {
102
109
updateLabels () {
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ export default {
97
97
mounted () {
98
98
this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
99
99
this .updateLabels ();
100
+ this .resizeObserver = new ResizeObserver (() => {
101
+ this .updatePoints ();
102
+ });
103
+ this .resizeObserver .observe (this .view .getContainer ());
104
+ },
105
+ beforeUnmount () {
106
+ this .resizeObserver .disconnect ();
100
107
},
101
108
methods: {
102
109
updateLabels () {
Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ export default {
42
42
},
43
43
mounted () {
44
44
this .trackVtkSubscription (this .widgetState .onModified (this .updatePoints ));
45
- this .updatePoints ();
45
+ this .resizeObserver = new ResizeObserver (() => {
46
+ this .updatePoints ();
47
+ });
48
+ this .resizeObserver .observe (this .view .getContainer ());
49
+ },
50
+ beforeUnmount () {
51
+ this .resizeObserver .disconnect ();
46
52
},
47
53
methods: {
48
54
async updatePoints () {
@@ -52,7 +58,9 @@ export default {
52
58
.filter ((state ) => state .isVisible ())
53
59
.flatMap ((state ) => state .getOrigin ());
54
60
55
- this .points = await this .mapToPixelSpace (handlePoints);
61
+ const promise = this .mapToPixelSpace (handlePoints);
62
+ this .view .render ();
63
+ this .points = await promise;
56
64
},
57
65
},
58
66
};
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ export default {
51
51
},
52
52
mounted () {
53
53
this .updatePoints ();
54
+ this .resizeObserver = new ResizeObserver (() => {
55
+ this .updatePoints ();
56
+ });
57
+ this .resizeObserver .observe (this .view .getContainer ());
58
+ },
59
+ beforeUnmount () {
60
+ this .resizeObserver .disconnect ();
54
61
},
55
62
methods: {
56
63
async updatePoints () {
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ export default {
56
56
mounted () {
57
57
this .trackVtkSubscription (this .widgetState .onModified (this .updatePoints ));
58
58
this .updatePoints ();
59
+ this .resizeObserver = new ResizeObserver (() => {
60
+ this .updatePoints ();
61
+ });
62
+ this .resizeObserver .observe (this .view .getContainer ());
63
+ },
64
+ beforeUnmount () {
65
+ this .resizeObserver .disconnect ();
59
66
},
60
67
methods: {
61
68
async updatePoints () {
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ export default {
85
85
mounted () {
86
86
this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
87
87
this .updateLabels ();
88
+ this .resizeObserver = new ResizeObserver (() => {
89
+ this .updatePoints ();
90
+ });
91
+ this .resizeObserver .observe (this .view .getContainer ());
92
+ },
93
+ beforeUnmount () {
94
+ this .resizeObserver .disconnect ();
88
95
},
89
96
methods: {
90
97
updateLabels () {
You can’t perform that action at this time.
0 commit comments