Outils pour utilisateurs

Outils du site


issue213:inkscape

Ceci est une ancienne révision du document !


Last month, I covered some of the smaller, less well publicized, changes and additions in Inkscape 1.4. Let’s have more of the same this month…

Spray tool

To be honest, the Spray Tool (Shift-F3 or ‘A’) is one that I very rarely use. I covered it in depth more than a decade ago, back in part 26 of this series (FCM #86), and the base functionality has changed little since then. It has acquired a few extra controls over the years, and the developers have even sneaked in some extra toolbar buttons with version 1.4 which aren’t mentioned in any of the release documentation I’ve seen. Some further experimentation will be required so that I can dedicate a future article to all the capabilities this tool now has.

For the time being, however, I’m only going to look at a couple of seemingly small changes in 1.4 which, in my opinion, greatly extend the utility of this tool. With these tweaks, the spray tool not only serves its main purpose of… well… spraying, but it also becomes a useful multi-stamping tool.

“Stamping” in Inkscape refers to a way of pasting multiple copies of an object, one-by-one. You simply drag the object in question around the canvas, and each time you press the spacebar, a copy is pasted at that location. If you need to quickly create a few copies of an object, it’s more efficient than repeatedly reaching for Ctrl-V then having to place the item in the required location. With snapping enabled, it makes for an extremely fast way to precisely place copies on your drawing. Version 1.3 introduced a variation on this theme whereby pressing the ‘C’ key, rather than the spacebar, will ‘stamp’ a clone rather than a copy.

The Spray Tool now offers a similar feature: select an object, but rather than ‘spraying’ it by clicking and holding the mouse button as you move the mouse around, a single click-and-release of the button will paste one copy of the object (or a clone, depending on the tool’s settings). Creating just a single copy or clone with a click isn’t new in itself, but there have been two changes in 1.4 that make this feature more useful: items created in this way are now placed at the center of the spray area, and the cursor shows a preview outline of the object before it’s created. These changes mean that you know exactly where your new object will be created, and the use of an outline may make this even better than the spacebar method in situations where the object might otherwise obscure the thing you’re trying to align it with.

This image shows a small purple star selected at the top-right. Next to it are two copies that have been created with single clicks, plus the cursor – complete with outline version of the star – positioned ready to create a third. Below, on the other hand, is the result of click-dragging on the canvas, without changing any parameters. Stamping and spraying with the same tool, depending on when you release the mouse button.

But I said it had become a multi-spray tool, so where’s the “multi” part? That kicks in when you have more than one item selected. This time I have three different objects selected, and you can see the cacophonous result of spraying those items below.

Stamping with single clicks brings more order to the chaos, but the choice of which objects gets stamped is still somewhat random for each click.

There is now, however, a way to cheat the system and stamp only the specific object you want at each location. By holding the right mouse button down while moving the mouse just a little bit, the spray tool will switch between your selected objects – indicated by the outline preview changing. It does sometimes take a couple of tries before it switches to the object you want, but with a little patience you can tame the randomness of the selection in order to create just the objects you want at each location, as you can see in this image, created in this way.

Whether this is actually any more efficient than stamping each of the shapes separately with the spacebar will depend on your specific drawing and requirements, but it’s always good to have more options available.

Snapping preferences

While you’re busy stamping new copies or clones with the Spray Tool, it’s likely that you’ll want to enable snapping to make sure they land where you want. In that case (or in any other where you use snapping), you might be interested in the new options that have been added to the Edit > Preferences dialog, in the Behaviour > Snapping pane.

Have you ever been trying to snap to a grid or guide, only to find the cursor wants to snap to a nearby object instead? If so, these new controls are just what you need. If that’s something that’s never bothered you, however, you can leave them all unchecked to stick with the normal behaviour of snapping to any valid nearby target.

Enabling the first two options causes Inkscape to snap only to grids or guides (or both), if they are visible. The last part of that sentence makes these options much more powerful than they first appear. If you’ve toggled the grid off (with the ‘#’ key), then “Always snap to grids” has no effect. Similarly, toggling off the guides (using Shift-| – that’s the “pipe” key) will render the “Always snap to guides” option inert.

Let’s have a more practical example using just a grid (though the same principle applies to guides). With a grid enabled in older versions of Inkscape, the cursor would snap to the grid intersections and to the object nodes, bounding boxes, and so-on – depending on what snapping options you have enabled. With “Always snap to grids” enabled, Inkscape will snap only to the grid intersections, regardless of whether any other snap targets are nearby. Hide the grid (‘#’) and the other snap targets kick in again, making it easy to constrain most of your work to the grid, but flip back to object snapping when needed.

The second set of checkboxes act as an override to the previous description. Suppose you want to always allow object snapping, even when you’ve otherwise constrained everything to snap to the grid? Enable the “Allow snapping to objects” checkbox in the preferences and object snap points will be considered as well as the grid.

(In case you’re wondering, “alignment snapping” and “distribution snapping” refers to the lines that appear to help you automatically align objects to existing things in your drawing, or space them evenly apart)

This whole snapping hierarchy is a little tricky to explain, so I’ll give you some rough rules-of-thumb to work by:

1/ If you’re happy with the way snapping works currently, don’t change anything. This should probably be the case for most users.

2/ If you get frustrated when Inkscape snaps to objects rather than your grid or guides, enable the relevant checkbox(es) in the first section and see if it improves matters. Toggle the visibility of the grid or guides when you need to snap to something else.

3/ If you generally like the behaviour with the first checkbox(es) enabled, but still want to snap to objects, or to have the align or distribute lines show up, enable the relevant checkbox(es) in the second section and see if it improves things for you. Once again, toggling the visibility of the grid or guides will switch back to using the “normal” snapping targets.

I don’t really think this is the best way to handle the hierarchy of which snap targets should take precedence, as it’s very difficult to conceptualise (and explain!) exactly how this works. But as someone who has occasionally tried to wrestle with a grid-based design while swearing at misplaced snapping points, I appreciate the attempt to try to do something to improve the situation.

Keyboard shortcuts

A few more keyboard shortcuts are now customizable via Edit > Preferences, in the Interface > Keyboard pane. If you wish to change any of these, the easiest thing to do is to search for part of their name. To that end, here’s a table of the newly available shortcuts, together with their default values (see table above)

In addition to these, a few existing features that previously did not have a keyboard shortcut by default now do. Note that this applies only to new installations of Inkscape, and you’ll need to set them yourself on an existing installation. For these purposes, running the AppImage version acts as a new installation. The same may also apply to other “containerized” package formats that come from third-party sources (such as your distribution’s repositories).

Note that in my AppImage copy of 1.4, all of these were set except the Inverse Clip shortcut. I’m not sure if the release notes are wrong or the AppImage config is incorrect, but if you use this feature a lot, it might be worth checking – and setting this shortcut if necessary.

Align & Distribute dialog

There’s been an attempt at a small, but welcome, quality-of-life improvement to the Align & Distribute dialog – except that it doesn’t work terribly well for me. This dialog can be used to align objects to each other, but also to align objects to the page or the drawing – the latter being the bounding box of all the objects on the canvas, whether they’re inside the page or not. When only a single object is selected, only the Page and Drawing options make sense… so Inkscape now limits the “Relative to” popup menu to show only those items (defaulting to Page). Select multiple items and the full list becomes available again.

This will work well for users who keep the dialog open all the time in a sidebar. For people like me, who prefer to open and close floating dialog windows as necessary, it doesn’t work so well. When the dialog is open, selecting a single object changes the popup as expected. But if a single object is selected first, and then the dialog is opened afterwards, it still shows the full list. It probably requires only a small fix to check the selected count when opening the dialog, but it’s a shame that it slipped through the cracks. I guess it confirms my suspicion that I’m in the minority as an old-school user who prefers dialogs in windows rather than permanently docked to the side of the window.

Next time I’ll cover a final selection of smaller changes that may have passed you by, before digging into some of the larger changes to 1.4 over the coming months. And if I manage to get through all those before the next major release, I guess I’ve now got the Spray Tool to revisit in more depth!

issue213/inkscape.1738408613.txt.gz · Dernière modification : 2025/02/01 12:16 de d52fr