summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2012-04-22 21:18:06 +0000
committerapenner <penner@vaxxine.com>2012-04-22 21:18:06 +0000
commit641c2388cab5d32517ea25df011d8568c8e6f227 (patch)
tree58c1e453bd7465915c3fb01c013fac694c5d9d2f /src
parentbetter UI message (diff)
downloadinkscape-641c2388cab5d32517ea25df011d8568c8e6f227.tar.gz
inkscape-641c2388cab5d32517ea25df011d8568c8e6f227.zip
pdf import. modify criterion for applying scaling to gradientTransform (Bug 985182)
Fixed bugs: - https://launchpad.net/bugs/985182 (bzr r11283)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/pdfinput/svg-builder.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index 6606e1846..2f36e19a4 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -57,6 +57,7 @@ namespace Internal {
#define TRACE(_args) IFTRACE(g_print _args)
static double ttm[6] = {1, 0, 0, 1, 0, 0}; // temporary transform matrix
+static bool ttm_is_set = false; // flag to forbid setting ttm
/**
* \struct SvgTransparencyGroup
@@ -214,7 +215,11 @@ Inkscape::XML::Node *SvgBuilder::pushGroup() {
setAsLayer(_docname);
}
}
-
+ if (_container->parent()->attribute("inkscape:groupmode") != NULL) {
+ ttm[0] = ttm[3] = 1.0; // clear ttm if parent is a layer
+ ttm[1] = ttm[2] = ttm[4] = ttm[5] = 0.0;
+ ttm_is_set = false;
+ }
return _container;
}
@@ -567,17 +572,14 @@ bool SvgBuilder::getTransform(double *transform) {
void SvgBuilder::setTransform(double c0, double c1, double c2, double c3,
double c4, double c5) {
// do not remember the group which is a layer
- if (_container->attribute("inkscape:groupmode") != NULL) {
- ttm[0] = ttm[3] = 1.0;
- ttm[1] = ttm[2] = ttm[4] = ttm[5] = 0.0;
- }
- else {
+ if ((_container->attribute("inkscape:groupmode") == NULL) && !ttm_is_set) {
ttm[0] = c0;
ttm[1] = c1;
ttm[2] = c2;
ttm[3] = c3;
ttm[4] = c4;
ttm[5] = c5;
+ ttm_is_set = true;
}
// Avoid transforming a group with an already set clip-path