Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Bug 1067190 - Handle singular gradient transform matrices in the GFX backend #1714

Merged
merged 2 commits into from Sep 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gfx/geometry.ts
Expand Up @@ -1054,6 +1054,10 @@ module Shumway.GFX.Geometry {
return false;
}

public static createIdentitySVGMatrix(): SVGMatrix {
return Matrix._svg.createSVGMatrix();
}

public static createSVGMatrixFromArray(array: number []): SVGMatrix {
var matrix: SVGMatrix = Matrix._svg.createSVGMatrix();
matrix.a = array[0];
Expand Down
7 changes: 6 additions & 1 deletion src/gfx/module.ts
Expand Up @@ -481,7 +481,12 @@ module Shumway.GFX {
var hasStyleTransformation = !!this.fillStyle._transform;
if (supportsStyle && hasStyleTransformation && path instanceof Path2D) {
var m = this.fillStyle._transform;
var i = m.inverse();
var i;
try {
i = m.inverse();
} catch (e) {
i = m = Geometry.Matrix.createIdentitySVGMatrix();
}
// Transform the context by the style transform ...
this.transform(m.a, m.b, m.c, m.d, m.e, m.f);
// transform the path by the inverse of the style transform ...
Expand Down