summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2014-11-03 18:42:13 +0000
committerapenner <penner@vaxxine.com>2014-11-03 18:42:13 +0000
commit346c58863ab3c563ebe8470a93e4a0ffbc251f95 (patch)
treedab4627f4c73db17f7cf86a181eabe953ef49502 /src
parentFix a bug pointed by Ivan Louette about strage fixed angle displazements (diff)
downloadinkscape-346c58863ab3c563ebe8470a93e4a0ffbc251f95.tar.gz
inkscape-346c58863ab3c563ebe8470a93e4a0ffbc251f95.zip
update svg-length-test.h from 90 to 96 dpi
(bzr r13664)
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp6
-rw-r--r--src/svg/svg-length-test.h14
2 files changed, 10 insertions, 10 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 6a091bd12..abc3b990c 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3661,7 +3661,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop)
if (hint_xdpi != 0) {
res = hint_xdpi;
} else {
- // if all else fails, take the default 90 dpi
+ // if all else fails, take the default 96 dpi
res = Inkscape::Util::Quantity::convert(1, "in", "px");
}
}
@@ -3709,7 +3709,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop)
double shift_x = bbox->min()[Geom::X];
double shift_y = bbox->max()[Geom::Y];
- if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid
+ if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 96 dpi, snap it to pixel grid
shift_x = round(shift_x);
shift_y = -round(-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone
}
@@ -3744,7 +3744,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop)
// TODO: avoid unnecessary roundtrip between data URI and decoded pixbuf
Inkscape::XML::Node * repr = xml_doc->createElement("svg:image");
sp_embed_image(repr, pb);
- if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid
+ if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 96 dpi, snap it to pixel grid
sp_repr_set_svg_double(repr, "width", width);
sp_repr_set_svg_double(repr, "height", height);
} else {
diff --git a/src/svg/svg-length-test.h b/src/svg/svg-length-test.h
index 81a28c9e7..fbdb7588d 100644
--- a/src/svg/svg-length-test.h
+++ b/src/svg/svg-length-test.h
@@ -164,13 +164,13 @@ SvgLengthTest::test_t const SvgLengthTest::absolute_tests[12] = {
{"1.00001", SVGLength::NONE, 1.00001 , 1.00001},
{"1px", SVGLength::PX , 1 , 1},
{".1px", SVGLength::PX , 0.1 , 0.1},
- {"100pt", SVGLength::PT , 100 , 125},
- {"1e2pt", SVGLength::PT , 100 , 125},
- {"3pc", SVGLength::PC , 3 , 45},
- {"-3.5pc", SVGLength::PC , -3.5 , -3.5*15.},
- {"1.2345678mm", SVGLength::MM , 1.2345678, 1.2345678*3.543307}, // TODO: More precise constants? (a 7 digit constant when the default precision is 8 digits?)
- {"123.45678cm", SVGLength::CM , 123.45678 , 123.45678*35.43307},
- {"73.162987in", SVGLength::INCH, 73.162987 , 73.162987*90}};
+ {"100pt", SVGLength::PT , 100 , 400.0/3.0},
+ {"1e2pt", SVGLength::PT , 100 , 400.0/3.0},
+ {"3pc", SVGLength::PC , 3 , 48},
+ {"-3.5pc", SVGLength::PC , -3.5 , -3.5*16.0},
+ {"1.2345678mm", SVGLength::MM , 1.2345678, 1.2345678*96.0/25.4}, // TODO: More precise constants? (a 7 digit constant when the default precision is 8 digits?)
+ {"123.45678cm", SVGLength::CM , 123.45678 , 123.45678*96.0/2.54},
+ {"73.162987in", SVGLength::INCH, 73.162987 , 73.162987*96}};
SvgLengthTest::test_t const SvgLengthTest::relative_tests[3] = {
{"123em", SVGLength::EM, 123, 123. * 7.},
{"123ex", SVGLength::EX, 123, 123. * 13.},