dugarab / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Endpoint Position in Pixels #260

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be very useful to be able to specify the location of an endpoint on an 
element in terms of it's distance from the top left corner in pixels rather 
than percents.

This is particularly useful in applications where the size of the element to 
which the endpoint is attached can change dynamically.

Original issue reported on code.google.com by behol...@gmail.com on 5 Jul 2012 at 5:10

GoogleCodeExporter commented 8 years ago
Sorry.  I meant to file this as a feature request.

Original comment by behol...@gmail.com on 5 Jul 2012 at 5:11

GoogleCodeExporter commented 8 years ago
You can probably use the 'offset' values of an anchor spec for this.  Anchors 
can be specified using either four values:

[ x proportion, y proportion, x orientation, y orientation ]

or with six:

[ x proportion, y proportion, x orientation, y orientation, x offset, y offset ]

so something like:

[ 0, 0, 0, -1, 50, 0 ]

would give you an anchor point 50 pixels from the left on the top edge of some 
element, with an 'upwards' orientation for connections from it.

Original comment by simon.po...@gmail.com on 6 Jul 2012 at 3:23

GoogleCodeExporter commented 8 years ago
have you had a chance to try this?

Original comment by simon.po...@gmail.com on 10 Jul 2012 at 10:26

GoogleCodeExporter commented 8 years ago
i've tested this:

http://jsfiddle.net/sporritt/D2vmB/3/

marking 'done'.  

Original comment by simon.po...@gmail.com on 12 Jul 2012 at 6:42

GoogleCodeExporter commented 8 years ago
Sorry (was on vacation).

This works.  Thank you!

Original comment by behol...@gmail.com on 17 Jul 2012 at 7:49

GoogleCodeExporter commented 8 years ago
cool - thanks for the update.

Original comment by simon.po...@gmail.com on 17 Jul 2012 at 8:45