diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-08-18 15:29:16 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-08-18 15:29:16 +0000 |
| commit | 3ffefe1e05e3858ce6584dc644817c411232dc77 (patch) | |
| tree | e992648f9c1598efe6c810009213dbf9b7b31ff4 /src/helper/png-write.cpp | |
| parent | Formatting last commit (diff) | |
| download | inkscape-3ffefe1e05e3858ce6584dc644817c411232dc77.tar.gz inkscape-3ffefe1e05e3858ce6584dc644817c411232dc77.zip | |
reduce usage of desktop coordinates (#341)
- avoid unnecessary internal usage of desktop coordinates, e.g.
in SpellCheck::compareTextBboxes
- document whether a function argument is in document or desktop
coordinates, e.g. for SPDocument::getItemsInBox
Diffstat (limited to 'src/helper/png-write.cpp')
| -rw-r--r-- | src/helper/png-write.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 1f2150cf1..802d1372d 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -407,6 +407,11 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, width, height, xdpi, ydpi, bgcolor, status, data, force_overwrite, items_only, interlace, color_type, bit_depth, zlib, antialiasing); } +/** + * Export an area to a PNG file + * + * @param area Area in document coordinates + */ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, Geom::Rect const &area, unsigned long width, unsigned long height, double xdpi, double ydpi, @@ -430,7 +435,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, doc->ensureUpToDate(); /* Calculate translation by transforming to document coordinates (flipping Y)*/ - Geom::Point translation = -(area * doc->dt2doc()).min(); + Geom::Point translation = -area.min(); /* This calculation is only valid when assumed that (x0,y0)= area.corner(0) and (x1,y1) = area.corner(2) * 1) a[0] * x0 + a[2] * y1 + a[4] = 0.0 |
