Hadrian Posted September 17, 2012 Share Posted September 17, 2012 Noticed that the API gave one the ability to rotate text frames as well. I have been using the x,y, width and height successfully with a correct preview in the desktop environment as well. I am using an external database for the values (in inches) as the template has different attributes for the 2 frames being referenced. Once when I add the rotation value I get the frame completely off where it should be. If I take the rotation off the preview is correctly aligned. I attached a screen shot of where the frame X is 2.99 and the Y is 3 and its pretty far off. Any help from anyone familiar with my dilemma would be greatly appreciated. below is the js sample of what i am using tag_frame.x = BrochureXDF.GetFieldValue(fschool, "tag x")*7200; tag_frame.y = BrochureXDF.GetFieldValue(fschool, "tag y")*7200; tag_frame.width = BrochureXDF.GetFieldValue(fschool, "tag w")*7200; tag_frame.height = BrochureXDF.GetFieldValue(fschool, "tag h")*7200; dtp_frame.x = BrochureXDF.GetFieldValue(fschool, "dtp x")*7200; dtp_frame.y = BrochureXDF.GetFieldValue(fschool, "dtp y")*7200; dtp_frame.width = BrochureXDF.GetFieldValue(fschool, "dtp w")*7200; dtp_frame.height = BrochureXDF.GetFieldValue(fschool, "dtp h")*7200; tag_frame.x.rotationAngle = 270; Quote Link to comment Share on other sites More sharing options...
Hadrian Posted September 17, 2012 Author Share Posted September 17, 2012 Just noticed that this is wrong and it was corrected but i still get the frame out of place tag_frame.x.rotationAngle = 270; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 17, 2012 Share Posted September 17, 2012 It's hard to tell what's going on just from the screen shot. The rotation is based on the center point of the frame before rotation. In this case, you've obviously moved the frame from its original position, so it's going to be rotated around the new position. Quote Link to comment Share on other sites More sharing options...
Hadrian Posted September 17, 2012 Author Share Posted September 17, 2012 I took a screen capture (attached) with the x,y, width and height that the original or static text frame has. I then took those values in inches and plugged them into a record. I also took off the rotation angle object from the OnRecordStart. By all accounts the alignment of the more slender text frame should be aligned exactly on top of the static or original text frame similar to the larger text frame. The only difference is obviously the rotation but the values are the exact and it is still throwing it off. Are you saying i need to create some type of offset value? Quote Link to comment Share on other sites More sharing options...
Hadrian Posted September 17, 2012 Author Share Posted September 17, 2012 I have to use the x and y coordinates before the rotation and not the values if they were rotated.......weak. On a visual standpoint that could be a headache if you need to troubleshoot Why cant FP say need the declaration of rotation or no rotation first and then use then use the true rotation alignment values? Got it to work but still a little backwards if you ask me.....my 2 cents. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 17, 2012 Share Posted September 17, 2012 The X and Y coordinates reference the original, unrotated position of the frame, regardless of any rotation applied. If it were otherwise, then things would be even more confusing for non-orthogonal (multiples of 90 degrees) rotations. What do you want the X and Y position to reference when the frame is rotated 45 degrees? This is true not just for the numbers you see in JavaScript; it's true for the numbers in the Frame Properties palette as well. Select any frame and then click on the up-down arrows next to the rotation value on the Frame Properties palette. You'll see that the X and Y positions don't change as you rotate the frame. The alternative is what InDesign does, where, when you rotate a frame 180 degrees, the whole frame jumps to a different position, even though the X and Y position shown remains the same. That's more confusing, in my opinion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.