diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-06 18:54:40 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-06 18:54:40 +0000 |
| commit | bb88a2cb94ec34ee838a972bab17ca05ba92d1da (patch) | |
| tree | 4b4580dbe1bec0968254d1b362611ab57ad3c223 /src/ui/clipboard.cpp | |
| parent | init SPStyle better: fixes a bunch of bugs resulting from improper re-init of... (diff) | |
| parent | Fixed bug in page sizer. (diff) | |
| download | inkscape-bb88a2cb94ec34ee838a972bab17ca05ba92d1da.tar.gz inkscape-bb88a2cb94ec34ee838a972bab17ca05ba92d1da.zip | |
Merge Google Summer of Code unit refactor.
(bzr r12471)
Diffstat (limited to 'src/ui/clipboard.cpp')
| -rw-r--r-- | src/ui/clipboard.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 72ddd90a9..629960613 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -79,7 +79,7 @@ #include "text-editing.h" #include "tools-switch.h" #include "path-chemistry.h" -#include "unit-constants.h" +#include "util/units.h" #include "helper/png-write.h" #include "svg/svg-color.h" #include "sp-namedview.h" @@ -1078,14 +1078,14 @@ void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/) try { if (out == outlist.end() && target == "image/png") { - gdouble dpi = PX_PER_IN; + gdouble dpi = Inkscape::Util::Quantity::convert(1, "in", "px"); guint32 bgcolor = 0x00000000; Geom::Point origin (_clipboardSPDoc->getRoot()->x.computed, _clipboardSPDoc->getRoot()->y.computed); Geom::Rect area = Geom::Rect(origin, origin + _clipboardSPDoc->getDimensions()); - unsigned long int width = (unsigned long int) (area.width() * dpi / PX_PER_IN + 0.5); - unsigned long int height = (unsigned long int) (area.height() * dpi / PX_PER_IN + 0.5); + unsigned long int width = (unsigned long int) (area.width() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); + unsigned long int height = (unsigned long int) (area.height() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5); // read from namedview Inkscape::XML::Node *nv = sp_repr_lookup_name (_clipboardSPDoc->rroot, "sodipodi:namedview"); |
