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 {
9797 mounted () {
9898 this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
9999 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 ();
100107 },
101108 methods: {
102109 updateLabels () {
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ export default {
9797 mounted () {
9898 this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
9999 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 ();
100107 },
101108 methods: {
102109 updateLabels () {
Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ export default {
4242 },
4343 mounted () {
4444 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 ();
4652 },
4753 methods: {
4854 async updatePoints () {
@@ -52,7 +58,9 @@ export default {
5258 .filter ((state ) => state .isVisible ())
5359 .flatMap ((state ) => state .getOrigin ());
5460
55- this .points = await this .mapToPixelSpace (handlePoints);
61+ const promise = this .mapToPixelSpace (handlePoints);
62+ this .view .render ();
63+ this .points = await promise;
5664 },
5765 },
5866};
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ export default {
5151 },
5252 mounted () {
5353 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 ();
5461 },
5562 methods: {
5663 async updatePoints () {
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ export default {
5656 mounted () {
5757 this .trackVtkSubscription (this .widgetState .onModified (this .updatePoints ));
5858 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 ();
5966 },
6067 methods: {
6168 async updatePoints () {
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ export default {
8585 mounted () {
8686 this .trackVtkSubscription (this .widgetState .onModified (this .updateLabels ));
8787 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 ();
8895 },
8996 methods: {
9097 updateLabels () {
You can’t perform that action at this time.
0 commit comments