Ovals changing size [JS CS4]

I create an oval and set it to be 10 inches in diameter as follows:
var thisDoc = app.documents.add();
thisDoc.documentPreferences.pageHeight = "11i";
thisDoc.documentPreferences.pageWidth = "11i";
thisDoc.documentPreferences.pageOrientation = PageOrientation.landscape;
thisDoc.documentPreferences.facingPages = false;
var thisPage = thisDoc.pages[0];
var inputValue = 100;
var valueToInches = inputValue * 0.05;  // 5
var circleXY = 5 - valueToInches;  // 5 - 5 = 0.5
var circleWH = 2 * valueToInches;  // 2 * 5 = 10
var useXY = circleXY + "i";  // specifying number in inches
var useWH = circleWH + "i";
var myCircle = thisPage.ovals.add({geometricBounds:[useXY, useXY, useWH, useWH]});
//  top left placed at 0, 0        -- as expected
// resulting circle is 10 x 10 in. -- as expected
When I offset it to center it on the page, the oval is created 0.5 inches smaller:
var thisDoc = app.documents.add();
thisDoc.documentPreferences.pageHeight = "11i";
thisDoc.documentPreferences.pageWidth = "11i";
thisDoc.documentPreferences.pageOrientation = PageOrientation.landscape;
thisDoc.documentPreferences.facingPages = false;
var thisPage = thisDoc.pages[0];
var inputValue = 100;
var valueToInches = inputValue * 0.05;  // 5
var circleXY = 5.5 - valueToInches;  // 5.5 - 5 = 0.5
var circleWH = 2 * valueToInches;    // 2 * 5 = 10
// specifying number in inches
var useXY = circleXY + "i";
var useWH = circleWH + "i";
// debug:
$.writeln(circleXY);  // "0.5"
$.writeln(circleWH);  // "10"
$.writeln(useXY);     // "0.5i"
$.writeln(useWH);     // "10i"
var myCircle = thisPage.ovals.add({geometricBounds:[useXY, useXY, useWH, useWH]});
//  top left placed at 0.5, 0.5      -- as expected
// resulting circle is 9.5 x 9.5 in. -- not expected
Perplexing. Any clues as to what I'm obviously doing wrong here?

Ovals, like all other objects, are not specified by [ x,y, width, height ].
The correct order in GeometricBounds is
[ topy, leftx, bottomy, rightx ]
-- you can simply add your width to your left x and your height to your top y to get the right numbers.

Similar Messages

  • Why does PDF Optimizer no longer reduce size after CS4 upgrade?

    I've been able to successfully reduce the size of the PDFs created from my Illustrator files for years using Advanced> PDF Optimizer in Acrobat Pro. Upgraded to CS4 last week. Now it seems to have reduced everything, but the files are still huge. When I check Space Audit 96% or more is taken up by "piece information".
    I've tried changing the Adobe PDF presets, the Document Raster Effects settings, and outlining all text in Illustrator to see if that made a difference. Nothing. The frustrating thing is i've done this for years with no problem. HELP?!?!

    From: Riannosda <[email protected]>
    Reply-To: <[email protected]>
    Date: Wed, 22 Jul 2009 07:06:34 -0600
    To: Pamela Myhre <[email protected]>
    Subject: Why does PDF Optimizer no longer reduce size
    after CS4 upgrade?
    Hi, I've found the solution because today it happened to me as well.
    Just go to "PDF Optimizer", then click to "Discard user data" and finally to
    "Discard private data from other applications": in this way you delete any
    information left by Illustrator and your file's size will get reduced.
    It works.
    Good luckThanks so much! That works like a charm!!
    Pamela

  • How change size of an anchored object ?

    Hello, I make a script that change size of a element by looking name (label and name).
    So It's work very well :
    var myStories = app.activeDocument.pageItems.everyItem().getElements();
    for(var i=0;i<myStories.length;i++){
    if(myStories[i].name=="Post_it"){
    var g_obj1 = get1(myStories[i]);
    var g_obj2 = get2(myStories[i]);
    var g_obj3 = get3(myStories[i]);
    var g_obj4 = get4(myStories[i]) + 5 ;
    myStories[i].geometricBounds = [g_obj1,g_obj2,g_obj3,g_obj4];
    But when I copy it and paste in a text to do a anchored object, it doesn't work!
    I check the name and the label, it's the same.
    Why it doesn't work when the object in anchored and how can I resolved it ?
    Thanks a lot!

    Yes! Very nice ! Thank a lot !
    Like this :
    var myStories = app.activeDocument.allPageItems;
    for(var i=0;i<myStories.length;i++){
            if(myStories[i]  instanceof TextFrame){
                    if(myStories[i].name=="Post_it" || myStories[i].label=="Post_it"){
                            var num_page_active = myStories[i].parentPage.name;
                            alert(num_page_active);
                            var g_obj1 = get1(myStories[i]);
                            var g_obj2 = get2(myStories[i]);
                            var g_obj3 = get3(myStories[i]);
                            var g_obj4 = get4(myStories[i]) + 5 ;
                            myStories[i].geometricBounds = [g_obj1,g_obj2,g_obj3,g_obj4];
    So, It's work! Now, I would like to do this only on the even page.
    In CS5, all is ok :
    var myStories = app.activeDocument.allPageItems;
    for(var i=0;i<myStories.length;i++){
            if(myStories[i]  instanceof TextFrame){
                    if(myStories[i].name=="Post_it" || myStories[i].label=="Post_it"){
                            var num_page_active = myStories[i].parentPage.name;
                             Number.prototype.isEven = function (){return (this%2 == 0) ? true : false;}
                            if(Number(num_page_active).isEven()==false){
                                var g_obj1 = get1(myStories[i]);
                                var g_obj2 = get2(myStories[i]);
                                var g_obj3 = get3(myStories[i]);
                                var g_obj4 = get4(myStories[i]) + 5 ;
                                myStories[i].geometricBounds = [g_obj1,g_obj2,g_obj3,g_obj4];
                                myStories[i].name="Post_it_Dec";
                                myStories[i].label="Post_it_Dec";
    But in CS4, the parent.name give me some problème that I can't resolved.
    In CS4, it does'nt know ".name" but ".label" only.
    So this does'nt work for CS4 :
    var myStories = app.activeDocument.allPageItems;
    for(var i=0;i<myStories.length;i++){
                                  if( myStories[i].label=="Post_it"){
                                            myStories[i].select();
                                            var num_page_active = myStories[i].parent.name;
                                            Number.prototype.isEven = function (){return (this%2 == 0) ? true : false;}
                                            if(Number(num_page_active).isEven()==false){
                                       var g_obj1 = get1(myStories[i]);
                                                                          var g_obj2 = get2(myStories[i]);
                                                                          var g_obj3 = get3(myStories[i]);
                                                                          var g_obj4 = get4(myStories[i]) + 5 ;
                                                                          myStories[i].geometricBounds = [g_obj1,g_obj2,g_obj3,g_obj4];
                                                                          myStories[i].label ="Post_it_Dec";
    Can you help me here or I create a new topic?

  • How do I change size of default fonts on OS X 10.9.4?

    How do I change size of default fonts on OS X 10.9.4?

    CS4 does run on Mavericks. The 150:30 error means licensing broke.
    Two ways to fix this: If you are used to the Terminal app, you download the license recovery package and following instructions carefully, you use the python script in the package.  Error "Licensing has stopped working"  | Mac OS
    I've done this and it works.
    If for some reason it doesn't, reinstall CS4 from your discs, or download the CS4 installer here.
    http://helpx.adobe.com/creative-suite/kb/cs4-product-downloads.html
    Have your serial number ready.
    Gene

  • I click on a link or start typing text in a box on a webpage, any page, and the browser window either randomly changes size, reduces & goes to the toolbar, or some other strange random thing occurs. Why is this?

    Whenever I am using Firefox, when I am on a webpage (any webpage) & I either click on a link in that page, start typing in a box, click on a button, or click on a tab, the browser window either reduces to the toolbar, or just changes size, usually from full-screen to 2/3 of its size. I reinstalled Firefox (downloaded from the web) after wiping my hard drive because I was having so many problems from my browser constantly crashing, to the computer itself crashing often, to the computer running exceptionally slow. At first everything seemed fine. But then after having opened my computer a few times, a few different windows began to freeze, then that stopped, then this thing with the browser started a few times later after opening it. Now it does it every time I open it. Also, whenever I try to click on a button on other windows on my computer, I get the 'warning' sound, nothing happens, then after a couple more tries, the button works. All of this is just weird. I had antivirus protection on my computer, but it apparently did not catch whatever virus infected my computer, or the damage was already done when it did get it. I thought once the hard drive was wiped, that everything would be ok, but then these weird things began to start up, and now I am wondering.... Of course, it could also be something wrong with the browser, too. I've also had some trouble getting my printer to working again, but I've managed to solve that problem.

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

  • When I change size of icons or icon vs list display, why does it affect the whole computer?

    When I change size of icons, or icon vs list display, why does it affect the whole computer? In some folders I want to see a list and others I want to see an icon and I don't need a large icon in all folders. I used to be able to set each folder separately in the old OS. How do I fix this?

    I can hilight an item, go to the finder/file/getinfo but there is no box next to icon view.
    I can go to view/options and adjust the icon size etc, but this applies to every folder in the whole computer. I need varied options in different folders, i.e., I want to view images as icons and text as text. I have to change it every time I open a folder. I used to be able to set it per folder in the old OS.

  • JButton changes size

    My button changes size when it has label START and STOP. How can i do, it not changes (sorry for my english)
      import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Ramka extends JFrame {
         JButton b2 = new JButton("START");
         JPanel p1 = new JPanel(new FlowLayout());
        JPanel p2 = new JPanel();
        JButton b1 = new JButton("NOWA GRA");
         public Ramka() {
              setTitle("Waz");
              setSize(500,350);
              setLocation(200,100);
              setResizable(false);
            //JButton b2 = new JButton("START");
            Container cp = getContentPane();
            p1.setBackground(Color.blue);
            p2.setBackground(Color.red);          
            cp.add(BorderLayout.NORTH,p1);
            cp.add(p2);
            p1.add(b1);
            //b2.setText("STOP");
              p1.add(b2);
              b2.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        if (b2.getText()=="START") {
                        b2.setText("STOP");}
                        else {
                             b2.setText("START");
    public class Waz {
         public static void main(String[] args) {
              Ramka ramka = new Ramka();
            ramka.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            ramka.show();
    }

    Add this as the last line of the constructor of Ramka:
    b2.setPreferredSize(b2.getPreferredSize());

  • New to flash, swf loaded while changing size

    i'm trying to create a button that will replace the current
    swf with another and i want the size to change between the various
    sizes of each page. i'm currently using the following code in the
    action inspector:
    on(release){loadMovieNum("myfilename.swf",0);
    i know there has to be a simple way to do this! a very
    grateful thanks to anyone who tries to help!

A: new to flash, swf loaded while changing size

b3autiful_dizaster wrote:
> i'm trying to create a button that will replace the
current swf with another
> and i want the size to change between the various sizes
of each page. i'm
> currently using the following code in the action
inspector:
>
> on(release){loadMovieNum("myfilename.swf",0);
> }
>
> i know there has to be a simple way to do this! a very
grateful thanks to
> anyone who tries to help!
You can't change size dynamically as it is defined by the
object embed tags.
You could use WMODE transparency which could help you fake it
tho not always best
solution to go with WMODE. It's a very buggy parameter.
WMODE will remove the background color so the flash movie
appear over the html and you
can see the HTML content trough the movie.
You could define some solid shape for the background on
bottom layer to make it look
like SWF background, than change it with the other loaded
movie making it appear as it
changed size while the over all flash size stats the same. As
said above - faking it.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>

b3autiful_dizaster wrote:
> i'm trying to create a button that will replace the
current swf with another
> and i want the size to change between the various sizes
of each page. i'm
> currently using the following code in the action
inspector:
>
> on(release){loadMovieNum("myfilename.swf",0);
> }
>
> i know there has to be a simple way to do this! a very
grateful thanks to
> anyone who tries to help!
You can't change size dynamically as it is defined by the
object embed tags.
You could use WMODE transparency which could help you fake it
tho not always best
solution to go with WMODE. It's a very buggy parameter.
WMODE will remove the background color so the flash movie
appear over the html and you
can see the HTML content trough the movie.
You could define some solid shape for the background on
bottom layer to make it look
like SWF background, than change it with the other loaded
movie making it appear as it
changed size while the over all flash size stats the same. As
said above - faking it.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>

  • Navigation Buttons Change Size

    My admittedly-crude website is taking shape but when I roll over the navigation buttons (which don't have actual links yet) the font type seems to change to bold and the button itself changes size to accomodate the larger font.
    www.ourhealthcare.info
    Any suggestions?
    Thanks.

    Line 219, has a syntax error.
    Change
    <li><a href="federalagency.html">Creating a Federal Healthcare Insurance Agency</a><li>
    to
    <li><a href="federalagency.html">Creating a Federal Healthcare Insurance Agency</a></li>
    The closing <li> has been changed to </li>.
    That should clear up the validation errors.

  • How do you change size of text cursor or 'insertion point' in adobe cc for mac?

    how do you change size of text cursor or 'insertion point' in adobe ID cc for mac?  I have looked everywhere.  It's possible in Windows and Word but not in Mac.  Please help.  I spend half my time trying to find that blinking upright bar.

    Thanks for your note but it’s still a skinny rod that seems to disappear.  Why can’t it become a little thicker so it doesn’t disappear no matter what size I have set the screen?  My poor old eyes aren’t what they used to be.  I do appreciate your answering and I’ll enlarge the screen so the blankety-blankety blinking rod is at least visible.  Nancy
    how do you change size of text cursor or 'insertion point' in adobe cc for mac?
    created by Peter Spier in InDesign - View the full discussion
    Cursor size is governed by the type size and will be be larger or smaller on screen depending on how close you are zoomed in.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6729964#6729964
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How do I change size of homepage,I can adjust all pages except homepage

    Controls to change size of homepage do not work

    Do you want to zoom the page or do you want to resize the window?

  • Photos and layouts change size when adding photos in book layout

    I am using the Classic layout to create books.
    Sometimes, when I move a photo down into the layout, unpredictable things happen. For example, when I drag a photo down onto the page layout, sometimes the photo will change sizes, and sometimes the layout will move around (esp. with 3 or 4 images on a page). On a page with a single image, sometimes the photo comes in large, and sometimes it shrinks. On a 3 photo per page layout, sometimes the layout starts with 3 photo boxes in a row. I can add one or two, and then I add another (could be the 1st, 2nd or 3rd - it's the image file that I think triggers the change) and all the boxes scramble and instead of a row of 3 equal-sized boxes, now I have a page with 1 big and 2 small boxes. Totally unpredictable!
    Is there any way to control this?
    All the photo files I'm starting with are high resolution tiffs, around 8 inches square (most are squares, not 4x6 snapshots) at 300 dpi.
    I have had this issue on 3 computers (and probably 2 different versions of iPhoto): a 2-year-old G5, and two brand new iMacs.
    Any help or advice is welcome. Thanks.
    iMac   Mac OS X (10.4.8)  

    If you Control-click on the square photo in a book frame you can select the "Fit photo to frame size" option and the entire image will be contained in the frame. there will be some white space on the short side.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Macbook Pros display blinks to blue, icons change size, resolution changes and cant reset. Anyone else have this and have a definitive idea of the cause? End up running diagnostics and resetting PRAM and SMC to resolve but why? Thanks.

    We have had several (7-10 recently) macbook Pros start this issue. The screen will jump from regular to blue, the background image will go away and it will be replaced with a blue screen, the icons change size and the screen resolution changes. Someimtes the users name field on the login screen will fly in from off screen... run diagnostics (AppleJack, Disk Util) and reset PRAM and SMC and sometimes this helps but wanted to know if there was a definite reason for this or a better resolution to the problem?
    Thanks all
    Macbook Pros are all newer (some only a month old) Unibody models running Snow Leopard and Lion

    AppleJack has been discontinued, so you should uninstall that.
    I'm suspecting something in software across all machine or a security breach as the primary cause of your problems.
    Wipe and install everything fresh, firmware update the router, change passwords, new software form original sources, etc.
    This might assist.
    Step by Step to fix your Mac
    WiFi security issues, at home and WiFi hotspots
    Harden your Mac against malware attacks
    How do I securely delete data from the machine?

  • VirtualizingStackPanel scrollbar changes size while scrolling

    Hi,
    I have a page in a metro style app which is based off the grouped items page template. It uses a VirtualizingStackPanel as the items panel for the grouped items and a wrapgrid for the items in a group. The horizontal scrollbar thumb for the page changed
    size while a user scrolls. This makes it difficult for a user with a mouse, but it does it with touch scrolling as well.
    When a create another blank app with the grouped items page template is behaves the same way out of the box. Is there something I can do or is this a bug?
    Thanks,
    Andrew

    This is a known issue unfortunately.  We hope to address it in the future.
    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog |
    @timheuer
    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

  • Desktop icons change size when I move the cursor

    Intermittently, when I move the cursor with my trackpad, the desktop icons change size—minimize going from 44 to 16 icon size. This happens with the Finder in the foreground or background.
    I think there's a fix, but I cannot find it.
    All help appreciated,
    Bill

    Press Command-Option-8. Someone apparently turned on Zoom. (See System Preferences > Universal Access and click the Options button next to Zoom for more information.)

  • Maybe you are looking for