February 17, 2006

Overstepping Your Bounds

I've discovered a seemingly small difference between the default behaviors of Illustrator and InDesign. However, the result of this small difference in behavior is cause for a much larger difference in functionality -- or more accurately, the result or your artwork and the amount of effort that's required to create your artwork to begin with. My discovery has to do with a setting in Illustrator's General preferences, called Use Preview Bounds, although as you're about to see, it's really more than just a preference setting.

First, what is the Use Preview Bounds setting? Well, as I discuss in my book, a vector path itself has no visual appearance -- it is invisible. A stroke attribute defines the appearance of a path. By default, Illustrator internally uses the vector path itself when calculating measurements, or when aligning objects.

For example, if you create a 10p x 10p rectangle and apply a 10pt stroke to that object, Illustrator will show a value of 10p x 10p in the Transform palette or in the Control palette for that object. By default, a stroke weight is set on the center of a path, meaning half of the stroke weight falls along each side of the vector path. In reality, the visual appearance of the shape is 10p10 x 10p10, not 10p x 10p.

Turning on the Use Preview Bounds preference (which is also available in the Align Palette's palette menu) will tell Illustrator to display the VISUAL size of the object, not the path size. So with the setting turned on, the Transform palette will display the value of 10p10 x 10p10. This preference appears in the Align palette because again, by default, Illustrator will align objects by their vector path boundaries, not their visual boundaries.

Now here's the difference in behavior between Illustrator and InDesign. In Illustrator, when you draw or move a shape and you want to snap that shape to a guide or the edge of your document (or another object), Illustrator snaps the vector path to the guide (see below).

In InDesign however, when you draw a shape, InDesign snaps the APPEARANCE (or "preview bounds" in Illustrator-speak) of the path to the guide (see below).

In addition, InDesign's default behavior is just the opposite of Illustrator's. When you create a shape, the value that's defined in the Control palette for the size of the shape includes the weight of the stroke. In order to see the size of the actual vector path and NOT the appearance of the path, you have to turn off the Dimensions Include Stroke Weight setting in the Control palette.

In fact, InDesign's behavior when editing paths actually CHANGES depending on what tool you are using. If you move an object using the Selection tool (the black arrow), then InDesign uses the preview bounds of the shape to snap to guides and other objects.

However, when you move an object using the Direct Selection tool (the white arrow), InDesign uses the actual vector path for snapping.

So there are obvious consequences to these small differences in behavior. In CS2, both InDesign and Illustrator have the ability to align the stroke weight to the inside of the path, which "solves" this issue, but again, out of the box, these minute differences are cause for much confusion as users wonder why the values that they see on screen aren't always the true representation of what they get when they print. More so, these changes make it look like AI and ID aren't precise because when you copy and paste from one program to the other, you see different values displayed. Really, the object itself hasn't changed -- rather, the way that AI and ID "see" the shape is what is changing.

Now who is right and who is wrong? Well, you know I won't open up that can of worms.... :)


Anne-Marie said...

Mordy, in answer to your final question, *you* are right. You are always right! :-)

Very interesting observation about what InDesign snaps to when using Selection vs Direct Selection tool! Thanks for the info...


Teri Pettit said...

It is not quite accurate to say that Illustrator snaps the vector bounding box to guides, grids, etc. Actually, Illustrator does not snap any bounding box to guides, grids, etc., no matter what the setting of Use Preview Bounds is. What it does is snap the mouse position to the guide or grid. So if you have fill hit on, and you mouse down on a place inside of an filled object that is, say, 1/3 the way in from the left and 1/4 the way down from the top of the object, that's what position will get snapped to the guide or grid.

What makes it seem like it is snapping the vector bounding box on simple objects like rectangles and circles is that the mouse down position by default snaps to anchor points (and if Smart Guides is on, it also snaps to path edges.) But there is no snapping of the mouse to the preview edges of strokes. You can't even select objects by the part of the stroke that falls outside the path edge.

Mordy Golding said...

Good point Teri. Although one of the things which I don't know how clear it was is that when drawing a new shape from scratch, AI snaps the path to the guide, but ID snaps the appearance of the stroke to the path. The result is that if I ever change the stroke weight in ID after I've created a shape, I will undoubtedly have to resize the shape again to re-snap to the guide. This is annoying to me and is cause for many problems in art production and in prepress work.

Anonymous said...

I greatly prefer Illustrator's way of doing things. Unfortunately, I rarely use the grid in Illustrator. I use it all the time in InDesign, but as soon as you put a stroke on something its position and size get tiny errors and precise positioning becomes impossible. Bah.