-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
Test file adapted from SVG provided by Stanimir Stamenkov @stanio in BATIK-1361.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,7 +287,7 @@ public void assign(SVGTransform transform) { | |
setScale(matrix.getA(), matrix.getD()); | ||
break; | ||
case SVGTransform.SVG_TRANSFORM_ROTATE: | ||
if (matrix.getE() == 0.0f) { | ||
if (matrix.getE() == 0f && matrix.getF() == 0f) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stanio
|
||
rotate(transform.getAngle()); | ||
} else { | ||
angleOnly = false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
See the NOTICE file distributed with this work for additional | ||
information regarding copyright ownership. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.sf.carte.echosvg.test.svg; | ||
|
||
import io.sf.carte.echosvg.transcoder.SVGAbstractTranscoder; | ||
import io.sf.carte.echosvg.transcoder.image.ImageTranscoder; | ||
|
||
/** | ||
* Checks for regressions in rendering of a document with animations. | ||
* | ||
* @author For later modifications, see Git history. | ||
* @version $Id$ | ||
*/ | ||
public class SVGAnimationRenderingAccuracyTest extends RenderingTest { | ||
|
||
private float time; | ||
|
||
public SVGAnimationRenderingAccuracyTest(float time) { | ||
super(); | ||
this.time = time; | ||
} | ||
|
||
@Override | ||
protected String getImageSuffix() { | ||
return (time == 0f) ? "" : "-t" + Float.toString(time); | ||
} | ||
|
||
/** | ||
* Returns the <code>ImageTranscoder</code> the Test should use | ||
*/ | ||
@Override | ||
ImageTranscoder getTestImageTranscoder() { | ||
ImageTranscoder t = super.getTestImageTranscoder(); | ||
t.addTranscodingHint(SVGAbstractTranscoder.KEY_SNAPSHOT_TIME, time); | ||
return t; | ||
} | ||
|
||
} |
This is still not quite right. In apache/xmlgraphics-batik#39 I've shown
matrix.e == 0 && matrix.f == 0
with non-zerocx
andcy
at 0/360-deg angles. The new condition will setcx
andcy
to zero in these cases. While the rendered result is the same at such angles, the serialized formrotate(0)
vs.rotate(0 50 50)
could be considered wrong. For example, animaterotate(0 50 50) → rotate(100 50 50)
is different fromrotate(0 0 0) → rotate(100 50 50)
.