Facing problems with polyline annotation in .NET MVC

Hello,

I am using annotation in my project,
when I use polyline the co-ordinates are not coming at where my mouse is and the polyline starts at different location in the documentpolyline.png (198.1 KB)
I recently updated the annotation version from 19.6 to 20.6 and the problem I am facing is the example which I get is coded in angular and I am using jQuery

1 Like

@Niteen_Jadhav

Could you please share the sample application? We’ll then look into this issue. Or let us know if you face this issue in any of these UI applications.

Hello and sorry for replying late,
here is code example for the same,
please note you need to change url of the image in your controller.

@Niteen_Jadhav

We are investigating this scenario. Your investigation ticket ID is ANNOTATIONNET-1867. You’ll be notified in case of any update.

awaiting for your kind revert on this

@Niteen_Jadhav

This issue is expected to be fixed in version 21.11. As there’s any further update, you’ll be notified.

In the previous versions it was working fine, can you please suggest us some alternate ways of doing this.

@Niteen_Jadhav

This fix is available in new version. As release gets on-board, you’ll be notified.

@Niteen_Jadhav To what document you are applying annotations could you please attach them also ?

And what points of annotation are you using (could you please provide a code of your polyline annotation ?

And also GroupDocs.Annotation 21.10 was released, you could update library and double check if the issue was fixed

it is happening with all type of document, I already attached sample application.

@Niteen_Jadhav did you updated library version to latest version of GroupDocs.Annotation on your sample ?

UPDATE:
I’ve checked with new version of library (on different browsers) - it is the same. Looks like the issue not
on the library side - the problem is in incorrect mouse coordinates from first click, try to adjust coordinates

@vitaliy.rezchikov we are grateful if we get a sample in jQuery as we are unable to get proper mouse co-ordinates for first and last click.
Awaiting for your kind response.

appreciate your timely support.

@Niteen_Jadhav
Looks like the issue is in this method

PaintHandler.prototype.transformPoint = function(x, y){

        this.p.x = x - (this.offset.x - window.pageXOffset);
        this.p.y = y - (this.offset.y - window.pageYOffset);
        
        return this.p.matrixTransform(this.m);
    
    }

in file

sampleAnnotation/Resources/annotation/js/svg.draw.js

At least if change coordinates there - polyline will be started from another place.

Then this method called here

// save the startpoint
this.startPoint = this.snapToGrid(this.transformPoint(event.clientX, event.clientY));

So looks like in clientx and clienty we have coordinates of the page, but there should be coordinates of first click.
In offset.x, offset.y, pageXOffset, pageYOffset cames 0. So “this.p.x” and “this.p.y” received page coordinates.

And then this coordinates go to snapToGrid method and we get another coordinates.

as for position calculation on jquery try to check

or something related