diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-10-10 14:32:35 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-10-10 14:32:35 +0000 |
| commit | cc1b3bd8508b4b4e53683ca7c0e339cc124c542c (patch) | |
| tree | addb8720f096b078a47289f20658e5e977c0b6db /src/viewbox.cpp | |
| parent | packaging scripts: fix syntax (diff) | |
| parent | Apply cx, cy, etc. from template to newly created document window. (diff) | |
| download | inkscape-cc1b3bd8508b4b4e53683ca7c0e339cc124c542c.tar.gz inkscape-cc1b3bd8508b4b4e53683ca7c0e339cc124c542c.zip | |
update to trunk (r13586)
(bzr r13506.1.111)
Diffstat (limited to 'src/viewbox.cpp')
| -rw-r--r-- | src/viewbox.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/viewbox.cpp b/src/viewbox.cpp index f59909abc..662b05686 100644 --- a/src/viewbox.cpp +++ b/src/viewbox.cpp @@ -164,16 +164,17 @@ void SPViewBox::set_preserveAspectRatio(const gchar* value) { void SPViewBox::apply_viewbox(const Geom::Rect& in) { /* Determine actual viewbox in viewport coordinates */ - double x = 0.0; - double y = 0.0; - double width = in.width(); - double height = in.height(); + /* These are floats since SVGLength is a float: See bug 1374614 */ + float x = 0.0; + float y = 0.0; + float width = in.width(); + float height = in.height(); // std::cout << " width: " << width << " height: " << height << std::endl; if (this->aspect_align != SP_ASPECT_NONE) { /* Things are getting interesting */ - double scalex = in.width() / this->viewBox.width(); - double scaley = in.height() / this->viewBox.height(); + double scalex = in.width() / ((float) this->viewBox.width()); + double scaley = in.height() / ((float) this->viewBox.height()); double scale = (this->aspect_clip == SP_ASPECT_MEET) ? MIN (scalex, scaley) : MAX (scalex, scaley); width = this->viewBox.width() * scale; height = this->viewBox.height() * scale; @@ -217,12 +218,12 @@ void SPViewBox::apply_viewbox(const Geom::Rect& in) { /* Viewbox transform from scale and position */ Geom::Affine q; - q[0] = width / this->viewBox.width(); + q[0] = width / ((float) this->viewBox.width()); q[1] = 0.0; q[2] = 0.0; - q[3] = height / this->viewBox.height(); - q[4] = x - q[0] * this->viewBox.left(); - q[5] = y - q[3] * this->viewBox.top(); + q[3] = height / ((float) this->viewBox.height()); + q[4] = x - q[0] * ((float) this->viewBox.left()); + q[5] = y - q[3] * ((float) this->viewBox.top()); // std::cout << " q\n" << q << std::endl; |
