Merge pull request #5021 from CodingFabian/issue-5020
Fixes mesh fill pattern with optional matrix
This commit is contained in:
commit
4be90c35f8
@ -226,24 +226,24 @@ ShadingIRs.Mesh = {
|
|||||||
return {
|
return {
|
||||||
type: 'Pattern',
|
type: 'Pattern',
|
||||||
getPattern: function Mesh_getPattern(ctx, owner, shadingFill) {
|
getPattern: function Mesh_getPattern(ctx, owner, shadingFill) {
|
||||||
var combinedScale;
|
var scale;
|
||||||
// Obtain scale from matrix and current transformation matrix.
|
|
||||||
if (shadingFill) {
|
if (shadingFill) {
|
||||||
combinedScale = Util.singularValueDecompose2dScale(
|
scale = Util.singularValueDecompose2dScale(ctx.mozCurrentTransform);
|
||||||
ctx.mozCurrentTransform);
|
|
||||||
} else {
|
} else {
|
||||||
var matrixScale = Util.singularValueDecompose2dScale(matrix);
|
// Obtain scale from matrix and current transformation matrix.
|
||||||
var curMatrixScale = Util.singularValueDecompose2dScale(
|
scale = Util.singularValueDecompose2dScale(owner.baseTransform);
|
||||||
owner.baseTransform);
|
if (matrix) {
|
||||||
combinedScale = [matrixScale[0] * curMatrixScale[0],
|
var matrixScale = Util.singularValueDecompose2dScale(matrix);
|
||||||
matrixScale[1] * curMatrixScale[1]];
|
scale = [scale[0] * matrixScale[0],
|
||||||
|
scale[1] * matrixScale[1]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Rasterizing on the main thread since sending/queue large canvases
|
// Rasterizing on the main thread since sending/queue large canvases
|
||||||
// might cause OOM.
|
// might cause OOM.
|
||||||
var temporaryPatternCanvas = createMeshCanvas(bounds, combinedScale,
|
var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords,
|
||||||
coords, colors, figures, shadingFill ? null : background);
|
colors, figures, shadingFill ? null : background);
|
||||||
|
|
||||||
if (!shadingFill) {
|
if (!shadingFill) {
|
||||||
ctx.setTransform.apply(ctx, owner.baseTransform);
|
ctx.setTransform.apply(ctx, owner.baseTransform);
|
||||||
|
Loading…
Reference in New Issue
Block a user