Hi Krzysztof and Karlisson,
On Thursday 28 January 2010 21:13:12 you wrote:
What is the last known version of Inkscape that behaves correctly?
Regards, Krzysztof
I investigated this issue a little and it seems that it actually did not work
(even) in Inkscape 0.46.
In 0.46, you can select invisible (clipped/masked) objects as well. The
difference is that you need to click inside bounding box of visible part of the
clipped object, so if you try this just with rectangles, it seems it is
working. However, if you try this with e.g. circles, you can select that
invisible part of the clipped object (provided you click inside the bounding
box).
In current version (to be precise r9020, but I think it is current enough),
you can select invisible parts of clipped objects even outside of that "small"
bounding box that was in effect in 0.46. Please note that you cannot select
invisible objects outside of area of drawing (as when you select "Resize page
to drawing or selection" in Document properties). So it appears handling of
bounding boxes is at least inconsistent in whether invisible parts of masked
objects should be selected or not.
So one may say that neither version behaves correctly.
The change in behavior described above was caused by revision 7451, in
nr_arena_item.cpp, nr_arena_item_invoke_update function, particularly:
@@ -272,7 +278,8 @@
item->state |= NR_ARENA_ITEM_STATE_INVALID;
return item->state;
}
- nr_rect_l_intersect (&item->bbox, &item->bbox,
&item->clip-
bbox);
+ // for clipping, we
need geometric bbox
+ nr_rect_l_intersect (&item->drawbox, &item->drawbox,
&item->clip-
bbox);
}
/* Masking */
if (item->mask) {
@@ -281,7 +288,14 @@
item->state |= NR_ARENA_ITEM_STATE_INVALID;
return item->state;
}
- nr_rect_l_intersect (&item->bbox, &item->bbox,
&item->mask-
bbox);
+ // for masking, we
need full drawbox of mask
+ nr_rect_l_intersect (&item->drawbox, &item->drawbox,
&item->mask-
drawbox);
+ }
I believe it is not good idea just to revert this change though, as it would
not solve the problem for non rectangular clip/mask and if I understood it
correctly it fixed some rendering issues.
Also I have thought about what the correct behavior really is. For clip it is
obvious, but what to do with ([semi]transparent/bitmap) masks?
One option would be to take the shape of mask when testing for hits. Other
option would be to look whether the mask completely hides the masked object at
the mouse location. (Probably this could be configurable as well)
Another issue is: what to do if clip/mask completely hides an object - how
could you select it then? (Maybe a toggle button or something to change
whether you want to be able to select invisible(masked-out) objects?)
I'll update the bugreport and add there some pictures describing how it does
(not) work, so that others in the bugreport are notified as well.
Best regards,
Martin Sucha