I'm trying to create a WPF program where the user can drag adorners on the vertices of a polygon to stretch and resize the shape. When the vertex is grabbed by the mouse and dragged it will redraw the polygon with the vertex in that position. I'm aware of the width/height fields that can be modified to rezise the overall shape but what I want to do is have only the vertex position changed and the polygon lines to redraw essentially a new polygon with the new vertex positions.
So far I have the ability to draw static sized polygons(rectangles) and have adorners positioned on the corners but the problem seems to be that when you drag the adorner the adorner box does not stay on the polygon vertex. I believe this is because the adorner is drawn relative to the position of the polygon (its adorned element) rather than the overall canvas it is being drawn on.
I'm wondering if there is a way to simply position the adorner to a screen coordinate rather than relative to the shape. My logic is that I can simply draw an adorner box using onRender()
at the polygon's vertex as the location and have the mouse drag function get the position of the mouse and change the polygon's vertex point directly thereby also changing the coordinates where the adorner is drawn. so far I have not been able to find a way to do this. is this even possible? Can an adorner be drawn always on the vertex so that it snaps to it when the shape is resized? If not does anyone know another way to do this?