diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-22 03:38:29 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-22 03:38:29 +0000 |
| commit | 4deb0f64f3bdab48475819a4d236f125594244f4 (patch) | |
| tree | b12f86cc1718c54a6010f49701baf3ddc498047c /src/sp-namedview.cpp | |
| parent | Ported away from and removed "sp-metrics.*". (diff) | |
| download | inkscape-4deb0f64f3bdab48475819a4d236f125594244f4.tar.gz inkscape-4deb0f64f3bdab48475819a4d236f125594244f4.zip | |
Ported "widgets/ruler.*" away from SPMetric.
(bzr r12380.1.48)
Diffstat (limited to 'src/sp-namedview.cpp')
| -rw-r--r-- | src/sp-namedview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index bf3adf816..d01185981 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1139,6 +1139,19 @@ SPMetric SPNamedView::getDefaultMetric() const } /** + * Returns namedview's default unit. + */ +Inkscape::Util::Unit const SPNamedView::getDefaultUnit() const +{ + if (doc_units) { + return *doc_units; + } else { + Inkscape::Util::UnitTable unit_table; + return *(new Inkscape::Util::Unit(unit_table.getUnit("pt"))); + } +} + +/** * Returns the first grid it could find that isEnabled(). Returns NULL, if none is enabled */ Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview) |
