#118 lasso selection of small objects

Niklas Beisert

The lasso selection shows a rectangular bounding box just around all the selected strokes. If the selected stroke is a) a dot or b) a more or less horizontal or vertical line, the bounding box becomes too thin to be useable. In fact, the bounding box has no center and therefore cannot be moved because all parts of the bounding box are now considered "edge" associated to scaling.

My proposal would be to define a minimum size for the resulting selection box. If it is below this size in X or Y direction, extend it. Alternatively, always leave a certrain margin around the selected strokes. Note that the resulting selection box is just a virtual object and does not directly correspond to the selected strokes (hence nothing else would be included in the selection).


  • Denis Auroux
    Denis Auroux

    I think this is indeed a bug, and agree that the right thing to do is to make the selection box larger, perhaps just by enforcing a minimum size (presumably in pixels, not in absolute paper units) -- without changing what items are part of the selection. Thanks for the suggestion!

    Sadly I don't have time to fix this now, even though it should be a pretty easy patch.


  • Niklas Beisert
    Niklas Beisert

    A workaround is to draw a dot somewhere not too close and not too far away. Then select the desired object together with the dot. Now the box can be moved and afterwards the dot can be erased.

  • Niklas Beisert
    Niklas Beisert

    An improvement would be to add some space around the box. A simple measure is the thickness of the maximum pen. Using this will also include even the thickest lines in the box. Right now, thick lines can slightly overlap with the boundary.

    Here's the proposed patch: I'd propose to add the following few lines

        // expand the bounding box by some amount (maximum pen)
      if (ui.selection->items != NULL) {
        ui.selection->bbox.top -= predef_thickness[TOOL_PEN][THICKNESS_MAX];
        ui.selection->bbox.bottom += predef_thickness[TOOL_PEN][THICKNESS_MAX];
        ui.selection->bbox.left -= predef_thickness[TOOL_PEN][THICKNESS_MAX];
        ui.selection->bbox.right += predef_thickness[TOOL_PEN][THICKNESS_MAX];

    just above

      if (ui.selection->items == NULL) {
        // if we clicked inside a text zone or image?

    in xo-selection.c -> void finalize_selectregion(void)

    see also the attached file which is based on the current code of 2012-07-05.

    This may not fully solve the above problem for a small zoon, but after zooming in the box will be sufficiently large to be shifted around.

  • Denis Auroux
    Denis Auroux

    Fixed in 0.4.8.

  • Denis Auroux
    Denis Auroux

    • status: open --> closed
    • Group: --> v1.0_(example)