summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2012-02-04 21:32:10 +0000
committerapenner <penner@vaxxine.com>2012-02-04 21:32:10 +0000
commite7281159491626d03d4a9d95b853ea90567e274a (patch)
treecaab0f4900c913715291afdece2151082ac1e7f4 /src
parentcppcheck tells us: scanf without field width limits can crash with huge input... (diff)
downloadinkscape-e7281159491626d03d4a9d95b853ea90567e274a.tar.gz
inkscape-e7281159491626d03d4a9d95b853ea90567e274a.zip
implement some switches between visual bbox and geometric bbox, depending on prefs (Bug 906952)
Fixed bugs: - https://launchpad.net/bugs/906952 (bzr r10935)
Diffstat (limited to 'src')
-rw-r--r--src/selection.cpp7
-rw-r--r--src/seltrans.cpp12
-rw-r--r--src/widgets/desktop-widget.cpp7
3 files changed, 22 insertions, 4 deletions
diff --git a/src/selection.cpp b/src/selection.cpp
index ff444fa98..412718994 100644
--- a/src/selection.cpp
+++ b/src/selection.cpp
@@ -425,7 +425,12 @@ boost::optional<Geom::Point> Selection::center() const {
return first->getCenter();
}
}
- Geom::OptRect bbox = visualBounds();
+ Geom::OptRect bbox;
+ if (Inkscape::Preferences::get()->getInt("/tools/bounding_box") == 0) {
+ bbox = visualBounds();
+ } else{
+ bbox = geometricBounds();
+ }
if (bbox) {
return bbox->midpoint();
} else {
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 922d13a72..e5a61abd0 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -281,8 +281,12 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s
// 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 (prefs->getInt("/tools/bounding_box") == 0) {
+ _visual_bbox = selection->visualBounds(); // Used for correctly scaling the strokewidth
+ } else {
+ _visual_bbox = _geometric_bbox;
+ }
_point = p;
if (_geometric_bbox) {
@@ -653,7 +657,11 @@ void Inkscape::SelTrans::_updateVolatileState()
//Update the bboxes
_bbox = selection->bounds(_snap_bbox_type);
- _visual_bbox = selection->visualBounds();
+ if (Inkscape::Preferences::get()->getInt("/tools/bounding_box") == 0) {
+ _visual_bbox = selection->visualBounds();
+ } else {
+ _visual_bbox = selection->geometricBounds();
+ }
if (!_bbox) {
_empty = true;
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 5b07cddf5..66777cf6a 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -1899,7 +1899,12 @@ sp_desktop_widget_update_scrollbars (SPDesktopWidget *dtw, double scale)
Geom::Rect darea ( Geom::Point(-doc->getWidth(), -doc->getHeight()),
Geom::Point(2 * doc->getWidth(), 2 * doc->getHeight()) );
- Geom::OptRect deskarea = darea | doc->getRoot()->desktopVisualBounds();
+ Geom::OptRect deskarea;
+ if (Inkscape::Preferences::get()->getInt("/tools/bounding_box") == 0) {
+ deskarea = darea | doc->getRoot()->desktopVisualBounds();
+ } else {
+ deskarea = darea | doc->getRoot()->desktopGeometricBounds();
+ }
/* Canvas region we always show unconditionally */
Geom::Rect carea( Geom::Point(deskarea->min()[Geom::X] * scale - 64, deskarea->max()[Geom::Y] * -scale - 64),