summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-01-27 22:03:02 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-01-27 22:03:02 +0000
commit5b962cdfdae8e7fee34211f7da4146eba5d763f9 (patch)
tree7ca839f8b4e6f2e67ed86915ba61641c0a10d714 /src/extension
parentupdate to trunk (diff)
parentProtect pdf and png exports from failure and output reasonalbe warnings. (diff)
downloadinkscape-5b962cdfdae8e7fee34211f7da4146eba5d763f9.tar.gz
inkscape-5b962cdfdae8e7fee34211f7da4146eba5d763f9.zip
update to trunk
(bzr r11950.1.237)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/implementation/xslt.cpp2
-rw-r--r--src/extension/internal/emf-print.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp
index 9dd9c83ee..bcea06cb5 100644
--- a/src/extension/implementation/xslt.cpp
+++ b/src/extension/implementation/xslt.cpp
@@ -177,7 +177,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename)
}
g_free(s);
- SPDocument * doc = SPDocument::createDoc(rdoc, filename, base, name, true);
+ SPDocument * doc = SPDocument::createDoc(rdoc, filename, base, name, true, NULL);
g_free(base); g_free(name);
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 3c27ac1b8..2680718cf 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -814,10 +814,10 @@ Geom::Path PrintEmf::pathv_to_simple_polygon(Geom::PathVector const &pathv, int
return(bad);
}
P1_lead = cit->finalPoint();
- if(Geom::are_near(P1_lead,P1))continue; // duplicate points at the same coordinate
+ if(Geom::are_near(P1_lead, P1, 1e-5))continue; // duplicate points at the same coordinate
v1 = unit_vector(P1 - P1_trail);
v2 = unit_vector(P1_lead - P1 );
- if(Geom::are_near(dot(v1,v2),1.0)){ // P1 is within a straight line
+ if(Geom::are_near(dot(v1,v2), 1.0, 1e-5)){ // P1 is within a straight line
P1 = P1_lead;
continue;
}
@@ -867,7 +867,7 @@ Geom::Path PrintEmf::pathv_to_rect(Geom::PathVector const &pathv, bool *is_rect,
P1_lead = cit->finalPoint();
v1 = unit_vector(P1 - P1_trail);
v2 = unit_vector(P1_lead - P1 );
- if(!Geom::are_near(dot(v1,v2),0.0))break; // P1 is center of a turn that is not 90 degrees
+ if(!Geom::are_near(dot(v1,v2), 0.0, 1e-5))break; // P1 is center of a turn that is not 90 degrees
P1_trail = P1;
P1 = P1_lead;
vertex_count++;
@@ -891,12 +891,12 @@ int PrintEmf::vector_rect_alignment(double angle, Geom::Point vtest){
int stat = 0;
Geom::Point v1 = Geom::unit_vector(vtest); // unit vector to test alignment
Geom::Point v2 = Geom::Point(1,0) * Geom::Rotate(-angle); // unit horizontal side (sign change because Y increases DOWN)
- if( Geom::are_near(dot(v1,v2), 1.0)){ stat = 1; }
- else if(Geom::are_near(dot(v1,v2),-1.0)){ stat = 2; }
+ if( Geom::are_near(dot(v1,v2), 1.0, 1e-5)){ stat = 1; }
+ else if(Geom::are_near(dot(v1,v2),-1.0, 1e-5)){ stat = 2; }
if(!stat){
v2 = Geom::Point(0,1) * Geom::Rotate(-angle); // unit vertical side
- if( Geom::are_near(dot(v1,v2), 1.0)){ stat = 3; }
- else if(Geom::are_near(dot(v1,v2),-1.0)){ stat = 4; }
+ if( Geom::are_near(dot(v1,v2), 1.0, 1e-5)){ stat = 3; }
+ else if(Geom::are_near(dot(v1,v2),-1.0, 1e-5)){ stat = 4; }
}
return(stat);
}
@@ -1091,7 +1091,6 @@ unsigned int PrintEmf::fill(
U_TRIVERTEX ut[2];
U_GRADIENT4 ug4;
U_RECTL rcb;
- Geom::Affine tf2;
U_XFORM tmpTransform;
double wRect, hRect;
@@ -1107,7 +1106,8 @@ unsigned int PrintEmf::fill(
Actual gradientfill records are either this entire rectangle or slices of it as defined by the stops.
*/
- tf2 = Geom::Rotate(-angle);
+ Geom::Affine tf2 = Geom::Rotate(-angle); // the rectangle may be drawn skewed to the coordinate system
+ tf2 *= tf; // the coordinate system of the rectangular path may be rotated
tmpTransform.eM11 = tf2[0];
tmpTransform.eM12 = tf2[1];
tmpTransform.eM21 = tf2[2];