Just tested. This modification causes weird dragging effect. So it does't seem to work.
On Wed, Mar 8, 2017 at 9:09 AM, Minglangjun Li <liminglangjun@...400...> wrote:
Hi all,
I notice that dragging objects in Inkscape becomes slow when the document contains a lot of objects. And there's already a bug report (#1198317 https://bugs.launchpad.net/inkscape/+bug/1198317) complains about it. It remains unresolved, though. I love Inkscape so I am willing to contribute. The big problem is Inkscape's codebase is too large for me. Currently I only find the following lines which may potentially be optimized (haven't tested).
=== modified file 'src/seltrans.cpp' --- src/seltrans.cpp 2016-10-24 22:58:43 +0000 +++ src/seltrans.cpp 2017-03-07 15:07:24 +0000 @@ -280,9 +280,13 @@ // (The special points are the handles, center, rotation axis, font baseline, ends of spiral, etc.)
// First, determine the bounding box
- _bbox = selection->bounds(_snap_bbox_type); _visual_bbox = selection->visualBounds(); // Used for correctly
scaling the strokewidth _geometric_bbox = selection->geometricBounds();
if (_snap_bbox_type == SPItem::VISUAL_BBOX) {
_bbox = _visual_bbox;
} else {
_bbox = _geometric_bbox;
}
_point = p; if (_geometric_bbox) {
In the previous mentioned bug report they said that the performance dropping has something to do with the bounding box computation. I don't get it. For simple shapes like circles, how can we compute their bbox. more efficiently? Another question is why should we compute the bbox. of the background objects when we drag an object? I think it's the real source of the performance issue. Am I right? Any help is appreciated. Thanks.
Regards, Minglangjun