Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Apparently my brain is to twisted by this problem to create a mathematical solution as I have now spent close to 4 hours coding and recoding. I have a referenced image in a stack that is larger than the stack. It can be dragged around as needed to view any part of the image. I want to rotate the image with the portion of the image at stack center staying at stack center. The following code seems like it should work but it doesn't
on mouseUp
put (the width of this stack/2) into tHCen
put (the height of this stack/2) into tVCen
put (the bottom of img "image"- tVCen) into tVOff
put (the right of img "Image" - tHCen) into tHOff
set the angle of img "image" to (the angle of img "image"+90)
set the top of img "image" to tVCen - tHOff
set the right of img "image" to tHCen + tVOff
end mouseUp
screenLoc does not seem to work well when using a dual monitor setup. This app requires two monitors with a control stack on the main screen and a display stack on a remote screen in full screen mode. That is why I used ..
put (the width of this stack/2) into tHCen
put (the height of this stack/2) into tVCen
to find the center. That is not the problem. The problem seems to be with the positioning of the stack after it is rotated so that that same point of the image is still at stack center.
Problem solved. It turns out that my script does work the way I expected. The problem comes in from starting with a zoomed in image. Since images with an angle of other than 0 can't change dimensions it was resizing to it's original state and so the offset numbers no longer matched