All Articles

Week 8 - OnCanvas Alignment Guides

Image

MERGED!

My Merge request was finally merged this week. With that Inkscape now finally has Alignment Snapping feature. And not only that, but I am very glad that I actually managed to implement distribution snapping too when it was actually a part of the extended goals in my GSoC proposal.

Larger Testing = More Bugs

With the features being now in the master branch, more people now get to test the functionality of the newly implemented snapping options. It is expected that with more people actually using the feature, there will me more bugs that are detected. Here I give a brief description of the bugs that have been found so far and I have already started working on them.

  • Oblique intersection alignment guides (Related Link) This is a very interesting bug that happens because the logic that combines the Alignment snap with Distribution only made sure that alignment snap was a straight line in only one direction and did not really care about the other direction.
  • Memory Leak in distribution Snapping (Related Link) Porbably the most important bug to fix, _findSidewaysSnaps had a memory leak and would cause random crashes while editing some files.
  • When dragging an object the Shift key can be held to temporarily disable snapping. This did work with Alignment and Distribution snaps but the indicators were not cleared and got stuck when Shift is held.
  • Fix self-snapping when creating a new object and trying to scale it immediately after. I discovered this bug only after the feature was merged but it was pretty easy to fix.
  • Alignment and Distribution snaps did not work when adjusting existing shapes. This was a pretty easy fix but took a long time to figure out what was going wrong.
  • Better positioning for distribution guides so they do not collide with alignment guides Distribution guides will now never overlap with the alignment guides. This will not cause confusion when snap distances are visible.
  • Distribution snapping no longer turned on by default. Distribution snapping can be a bit (not incredibly) slow when there are a lot of objects on the canvas. Most of the times for complex vector drawings I dont think users will need distribution snapping and it can be annoying.