Outils pour utilisateurs

Outils du site


issue212:inkscape

Ceci est une ancienne révision du document !


If you’ve already downloaded Inkscape 1.4 (you have, haven’t you?), then you may have had a glance through the release announcement and concluded that not a huge amount has been added or changed in this release. While it’s true that a lot of the development work in 1.4 has focused on the internals of the program, in preparation for a future migration to the GTK4 toolkit, there have also been a lot of smaller changes that didn’t necessarily make it into the release announcement – and which will keep this column populated for a while. Of course, I’ll be covering the big headline changes, but this month I’m going to cover a few of these smaller changes that are likely to be overlooked by other sources of Inkscape info.

New Guide Lock State

The first change is an attempt to address a genuine user experience issue with guides, but personally I think it has potentially introduced more problems than it solves. I’ll begin by explaining the scenarios in which this problem occurs, then describe the old and new behaviours.

Guides are a very handy tool in Inkscape. For those unfamiliar with them, they’re lines that are drawn above all other content in Inkscape, but which do not appear in an exported bitmap, or if the SVG file is loaded into another program. They’re purely an aid to help you align and position items in your document, and are often used as snap targets. Creating a guide is as simple as clicking and dragging from the ruler at the top or side of the canvas – a guide line will follow the mouse as you move it into the window, and then be placed where you release the mouse. If you drag down from the top ruler, you’ll generally get a horizontal guide. If you drag across from the left ruler you’ll generally get a vertical guide. I say “generally” because if you drag from the extreme ends of either ruler, you’ll get a guide at a 45° angle.

There are other ways to create guides – such as creating them from a shape you’ve drawn using Object > Object to Guides – but the usual drag-from-ruler approach is all we need to concern ourselves with right now.

Double-clicking on any guide opens a dialog that allows you to position them precisely, or move them a relative amount, as well as change their color, angle, and label.

Using this dialog, you can also lock a guide to prevent it being accidentally moved… but it’s here that the UX problems begin. A guide can be in one of three states: locked, normal and hovered (when the mouse hovers over an unlocked guide). The scaled-up image below shows these three states – note that the locked state has a small cross as its handle, while a hovered guide changes color.

The problem is that, once locked, a guide can’t be modified at all. Moving the mouse over it doesn’t change the color to indicate the hovered state, you can’t drag it to a different location, and you can’t double-click on it to re-open the guide’s properties dialog. In case you were wondering, the handle is equally immune to interaction.

To my mind, this is overkill. In almost every scenario I can think of, a user would want a locked guide to ignore any accidental attempts to move it to a different location. But they absolutely would want a way to open the properties dialog to change its color, delete it, or reposition it using the numeric input fields. Most notably, without access to this dialog there’s not really a way to unlock an individual guide once you’ve locked it. Preventing dragging of the guide, but still allowing access to the dialog by double-clicking on the line itself, or at least on the handle, would have been a sensible solution, but no version of Inkscape allows this.

There are ways to unlock or delete locked guides, but they are broad and excessive for most use cases. In the Edit menu, you’ll find a “Delete All Guides” option. This does exactly what it says, and immediately deletes all guides, whether locked or not. It’s obviously not very useful if you want to remove only a single guide.

Just above it in the menu, however, is an entry with a checkbox next to it, labelled as “Lock All Guides”. If any guides exist that are not locked, the checkbox will be clear and selecting this entry will lock all of the guides in the document. If every guide is already locked, the checkbox will have a tick in it, and selecting this will unlock all of them. Yes, every single one – even the ones you wanted to keep locked.

There is also an easily overlooked button at the top left of the canvas which not only reflects the state of that checkbox, but which can be clicked to lock or unlock all the guides without having to select the menu entry. Here you can see that the padlock icon is shown as open on the left, when not all of the guides are locked; clicking on the button locks all of them and changes the icon, as shown on the right. Note, however, that manually locking all the guides using their corresponding properties dialog does not change this icon to its locked state.

This button, or the menu entry, are the only ways (other than the XML Editor) to unlock a guide. But much like the delete option, it’s a broad brush that will unlock every guide, even if you need to adjust only one of them.

This is where the second UX faux pas kicks in – the one that has been “fixed” in version 1.4. Let us suppose that you’ve set up some useful guides, perhaps for page margins or columns. You don’t want to accidentally move them around, so you click the button to lock them all. Later you decide to add a guide to help you with the design of your image. It’s just a temporary thing to aid with alignment, so you drag it roughly into place, planning to open the properties dialog and adjust it to a specific position. In older versions of Inkscape, dragging out a new guide while the global lock is enabled would create a guide that was already in the locked state. If you didn’t drop it in exactly the right location, or if you wanted to make any other changes to it, you would need to unlock all the guides in order to be able to access its properties dialog. That means unlocking all the page layout guides as well, even though you really want them to remain locked.

But Inkscape 1.4 fixes this problem! Hurrah! Right?

Wrong. The “fix” that has been implemented is simply that dragging out a new guide will automatically unlock all the guides for you. Sure, it saves a click or two, but it also means that those page layout guides get automatically unlocked – except this time it may not be so obvious to a novice user until they accidentally move them. To aid in the discovery of this new feature, the lock button flashes briefly when you drag out a new guide. But at that point, your focus is likely to be on your new guide, not some small button at the corner of the canvas that you’ve probably never really noticed before.

This change was created by a new contributor to Inkscape, and I don’t want to be too harsh on them for attempting to do something about the problem of guides being created in a locked state. On the contrary, I absolutely applaud them for getting involved with Inkscape development, and I hope they continue with their contributions. In reducing the number of clicks that a user might need to make, this does actually improve the situation for many users – it’s just that I feel it’s a band-aid instead of the much larger change that is actually required.

In my opinion, Inkscape needs a separate Guides dialog. Not the existing properties dialog that shows the details of only one guide at a time, but rather a dialog that lists all the guides in the document, and allows their properties to be changed individually. With such a dialog, it would be trivial to unlock a single guide at a time. But it would also make it possible to change the color, position or other properties of an individual guide without unlocking it first. The Lock All and Delete All options could be subsumed into the dialog, reducing the number of entries in the Edit menu as well. And when a new guide is dragged onto the canvas, it could simply be created in an unlocked state, without affecting the status of all the other guides. It sounds straightforward, but it would require a significant amount of work. Personally, I think the user experience benefits would make it worth the effort, but then I’m not an Inkscape developer.

Pen Segments to Guides

The next small addition is also related to guide creation. A new command has been added to the Pen tool (aka Bézier tool) which will convert the currently drawn shape to guides. There’s no UI for this command, but it has been added to the list of keyboard shortcuts, albeit without any binding by default. To enable this, you therefore have to set the shortcut you wish to use: open the Inkscape preferences dialog (Edit > Preferences), select the Interface > Keyboard pane, then expand the Tool section in the shortcuts list, or just search for “Pen Segments to Guides”. Click in the “Shortcut” column (the content should change to “New Accelerator…”), then press your desired shortcut combination. I chose Alt-Shift-G, which was the only “G” combination that didn’t elicit a complaint that it was already assigned.

Once you’ve set a shortcut, use the Pen tool to draw a shape, then press your key combination to convert it to guides. The cynic in me would like to point out, however, that in my testing, the behavior was exactly the same as when a path is selected and Object > Objects to Guides is used. That menu entry also comes with a default shortcut of Shift-G already set. Unless I’m missing something, I can’t really see any benefit in having (and remembering) a special Pen tool specific shortcut rather than just using the more generic option.

Creating Perfect Squares

Having complained about the UX of one feature, and questioned the entire point of another, I feel the need to redeem this column with a genuinely useful addition. When using the Rectangle or Ellipse tool, it’s always been possible to force the resultant shape to an integer ratio (and also the “golden ratio” of 1:1.618) by holding the Ctrl-key as you drag out your shape. The status bar even tells you what ratio it’s constrained to as you do so – a nice touch that many users have probably never even noticed. By moving close to a 45° angle from your starting point you can keep the ratio at 1:1 in order to create perfect squares or circles.

With the Ellipse tool, there was an additional option. Hold Ctrl-Alt and you would always create a circle – albeit one whose circumference passes through your original starting point. This is useful for creating circumscribing circles, whereas the behavior without the Alt key is more suited to inscribed circles. Nevertheless, a side-effect of this is that the Ellipse tool had a means of always creating a perfect circle, without the requirement to drag the mouse close to 45°.

With 1.4, this same Ctrl-Alt shortcut does something similar for squares. The drawn object doesn’t rotate around the starting point in the same way as when drawing a circle, but it does flip to one of the four quadrants depending on the mouse position. Too many novice users have struggled with the seemingly basic task of drawing a perfect square, and while there are several different ways to achieve this with Inkscape, this keyboard shortcut is perhaps the easiest to explain.

Arrow Keys on a Rotated Canvas

Do you sometimes rotate the canvas while working? Do you also move objects or nodes using the arrow keys? If your expectation is that the arrow keys should move things horizontally and vertically, regardless of the rotation of the canvas, then you’re in luck, as this is now the default behavior for Inkscape 1.4. If, however, you prefer the movement to remain relative to the canvas rotation, you can switch back to this behavior by unchecking the “Arrow keys move object relative to screen” option in the Behaviour > Steps pane of the Inkscape preferences dialog (Edit > Preferences). It’s a shame there’s not a keyboard shortcut to toggle this option, as I can see that both approaches could have their merits, even when working with a single document.

Behavior When Deleting Nodes

The final small change I’ll mention this month will be good news for anyone who didn’t like the change in 1.3 to the behaviour of the Node tool (F2) when deleting nodes. Prior to that version, when deleting a node using the Del key, Inkscape would try to preserve the general shape of the path, even if that meant moving the handles of adjacent nodes around. With version 1.3, a degree of autodetection was added which would sometimes move handles and sometimes not, depending on the sharpness of the corner. Generally I think it does a reasonable job, but if you prefer the old behavior, you can now switch back to it by unchecking the “Deleting node preserves shape” option in the Tools > Node Tool pane of the Edit > Preferences dialog.

It’s also worth noting that the Ctrl-Del shortcut will delete the node and force the segment to be a straight line, regardless of the state of this checkbox – as has always been the case throughout all versions of Inkscape.

issue212/inkscape.1735317838.txt.gz · Dernière modification : 2024/12/27 17:43 de auntiee