I need to develop a program in mdl that will allow a user to resize a rectangle. The user can select any corner point or side and drag to a new position. This would be similar to resizing a window or cropping a picture and needs to be interactive. There is no problem when the rectangle is not rotated, but of course, the user would like this to work with a rotated rectangle.
I am able to scale the rectangle using mdlElmdscr_transformAllowModification as has been documented in several posts in this forum. However, I have not been able to let the user change the width and the height and update the aspect ratio while maintaining right angles. If I vary the scale in the X or Y direction, the rectangle is distorted.
There was one post about rotating the element to a normal view, resizing and rotating it back, but I'm not quite sure how to do this while a user is dragging points or lines with the cursor. I was hoping there would be a suggesting on how to do this while maintaining the current rotation.
I'm building this using compiler Version 08.05.02.27 and running in Navigator v 08.11.09.713.
Sample code:
mdlTMatrix_getIdentity(&tMatrix); mdlTMatrix_scale(&tMatrix,NULL,xscale,yscale,1); mdlTMatrix_setOrigin(&tMatrix,&originPt); mdlElmdscr_transformAllowModification(&edP,&tMatrix,gRefModelP,gRefModelP,0);