Closed Trufinol closed 6 months ago
Getting the red dot to appear at the right position has been a weirdly difficult thing to make work robustly for all page layouts.
All we want to do is transform a 2D position from canvas coordinates to page coordinates, but it seems that no matter what we've tried so far, there's always some layout for which our built-in function doesn't work correctly.
Therefore, I made that canvas->page 2D transformation user-configurable via a canvasToPagePos
callback on the measurements plugins.
Could you see if you can implement this callback to do the transformation yourself - see this example: https://github.com/xeokit/xeokit-sdk/blob/master/examples/measurement/angle_createWithMouse_snapping_canvasToPagePos.html#L194
Then, if you find something that works, that might give us a clue on how to more correctly implement the mapping internally.
Thanks
Thank you for the hint.
In my case, applying canvasPos
to pagePos
fixed the issue.
However, in the typescript definition the canvasToPagePos
is missing at both DistanceMeasurementsMouseControl and AngleMeasurementsMouseControl.
https://github.com/xeokit/xeokit-sdk/blob/master/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts https://github.com/xeokit/xeokit-sdk/blob/master/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts Is it possible to include it in the next minor release or do you need any participation on this?
Thank you for the hint. In my case, applying
canvasPos
topagePos
fixed the issue. However, in the typescript definition thecanvasToPagePos
is missing at both DistanceMeasurementsMouseControl and AngleMeasurementsMouseControl.https://github.com/xeokit/xeokit-sdk/blob/master/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts https://github.com/xeokit/xeokit-sdk/blob/master/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts Is it possible to include it in the next minor release or do you need any participation on this?
Oops I'll fix that tonight - https://github.com/xeokit/xeokit-sdk/issues/1481
Is this bug fix critical for your commercial enterprise? no
Describe the bug When a viewer is mounted inside a modal window, the red dot position of a AngleMeasurementsPlugin or DistanceMeasurementsPlugin does not match the cursor position.
To Reproduce Steps to reproduce the behavior:
Expected behavior Red dot should be positioned on the mouse cursor.
Screenshots
Desktop (please complete the following information):