diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-10 06:57:53 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-10 06:57:53 +0000 |
| commit | 2b3f179e9c9e8f7d3836dc7350d34ebcc03f8326 (patch) | |
| tree | 07d53177432172f888df8be9ec0476f68aeba1cb /src/sp-namedview.cpp | |
| parent | Set class attribute values of selected objects using style dialog (diff) | |
| parent | Fix make test target (diff) | |
| download | inkscape-2b3f179e9c9e8f7d3836dc7350d34ebcc03f8326.tar.gz inkscape-2b3f179e9c9e8f7d3836dc7350d34ebcc03f8326.zip | |
Merge changes from trunk
(bzr r14949.1.4)
Diffstat (limited to 'src/sp-namedview.cpp')
| -rw-r--r-- | src/sp-namedview.cpp | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 06e068c42..616ec3921 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -59,25 +59,25 @@ static gboolean sp_str_to_bool(const gchar *str); static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color); SPNamedView::SPNamedView() : SPObjectGroup(), snap_manager(this) { - this->zoom = 0; - this->guidecolor = 0; - this->guidehicolor = 0; - this->views.clear(); - this->borderlayer = 0; - this->page_size_units = NULL; - this->window_x = 0; - this->cy = 0; - this->window_y = 0; - this->svg_units = unit_table.getUnit("px"); // legacy behavior: if no viewbox present, default to 'px' units + + this->zoom = 0; + this->guidecolor = 0; + this->guidehicolor = 0; + this->views.clear(); + this->borderlayer = 0; + this->page_size_units = NULL; + this->window_x = 0; + this->cy = 0; + this->window_y = 0; this->display_units = NULL; - this->page_size_units = NULL; - this->pagecolor = 0; - this->cx = 0; - this->pageshadow = 0; - this->window_width = 0; - this->window_height = 0; - this->window_maximized = 0; - this->bordercolor = 0; + this->page_size_units = NULL; + this->pagecolor = 0; + this->cx = 0; + this->pageshadow = 0; + this->window_width = 0; + this->window_height = 0; + this->window_maximized = 0; + this->bordercolor = 0; this->editable = TRUE; this->showguides = TRUE; @@ -261,16 +261,6 @@ void SPNamedView::build(SPDocument *document, Inkscape::XML::Node *repr) { // backwards compatibility with grid settings (pre 0.46) sp_namedview_generate_old_grid(this, document, repr); - - // If viewbox defined: try to calculate the SVG unit from document width and viewbox - if (document->getRoot()->viewBox_set) { - Inkscape::Util::Quantity svgwidth = document->getWidth(); - Geom::Rect viewbox = document->getRoot()->viewBox; - double factor = svgwidth.value(unit_table.primary(Inkscape::Util::UNIT_TYPE_LINEAR)) / viewbox.width(); - svg_units = unit_table.findUnit(factor, Inkscape::Util::UNIT_TYPE_LINEAR); - } else { // force the document units to be px - repr->setAttribute("inkscape:document-units", "px"); - } } void SPNamedView::release() { |
