diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2013-05-12 12:36:06 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2013-05-12 12:36:06 +0000 |
| commit | bf463fba185a4e67d25efe324a577cf89dcdce5f (patch) | |
| tree | 768949cc7e5dfc2541da7d07455b8cc3fc477a97 /src/seltrans.cpp | |
| parent | Fix for Bug #181493 (Locked layers not completely locked) by frenchie4111. (diff) | |
| download | inkscape-bf463fba185a4e67d25efe324a577cf89dcdce5f.tar.gz inkscape-bf463fba185a4e67d25efe324a577cf89dcdce5f.zip | |
Fix for Bug #448872 (Changing the bounding box type in preferences does not update the preview) by Vinipsmaker.
Fixed bugs:
- https://launchpad.net/bugs/448872
(bzr r12329)
Diffstat (limited to 'src/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp index b6c6baaf7..84c73e452 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -86,6 +86,17 @@ static gboolean sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer return FALSE; } +Inkscape::SelTrans::BoundingBoxPrefsObserver::BoundingBoxPrefsObserver(SelTrans &sel_trans) : + Observer("/tools/bounding_box"), + _sel_trans(sel_trans) +{ +} + +void Inkscape::SelTrans::BoundingBoxPrefsObserver::notify(Preferences::Entry const &val) +{ + _sel_trans._boundingBoxPrefsChanged(static_cast<int>(val.getBool())); +} + Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _desktop(desktop), _selcue(desktop), @@ -103,7 +114,8 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _origin_for_bboxpoints(Geom::Point(0,0)), _chandle(NULL), _stamp_cache(NULL), - _message_context(desktop->messageStack()) + _message_context(desktop->messageStack()), + _bounding_box_prefs_observer(*this) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int prefs_bbox = prefs->getBool("/tools/bounding_box"); @@ -169,6 +181,8 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : ); _all_snap_sources_iter = _all_snap_sources_sorted.end(); + + prefs->addObserver(_bounding_box_prefs_observer); } Inkscape::SelTrans::~SelTrans() @@ -873,6 +887,15 @@ void Inkscape::SelTrans::_selModified(Inkscape::Selection */*selection*/, guint } } +void Inkscape::SelTrans::_boundingBoxPrefsChanged(int prefs_bbox) +{ + _snap_bbox_type = !prefs_bbox ? + SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX; + + _updateVolatileState(); + _updateHandles(); +} + /* * handlers for handle move-request */ |
