.clip was not working, the path never made it to the clip area
This commit is contained in:
parent
c909ae09d7
commit
769f20b0e1
@ -1029,6 +1029,7 @@
|
|||||||
id = randomString(this.__ids),
|
id = randomString(this.__ids),
|
||||||
newGroup = this.__createElement("g");
|
newGroup = this.__createElement("g");
|
||||||
|
|
||||||
|
this.__applyCurrentDefaultPath();
|
||||||
group.removeChild(this.__currentElement);
|
group.removeChild(this.__currentElement);
|
||||||
clipPath.setAttribute("id", id);
|
clipPath.setAttribute("id", id);
|
||||||
clipPath.appendChild(this.__currentElement);
|
clipPath.appendChild(this.__currentElement);
|
||||||
|
@ -332,4 +332,16 @@ describe('canvas2svg', function() {
|
|||||||
expect(svg.querySelector("path").getAttribute("stroke-opacity")).to.equal(''+0.8*0.5);
|
expect(svg.querySelector("path").getAttribute("stroke-opacity")).to.equal(''+0.8*0.5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("supports clip", function() {
|
||||||
|
it("adds clippath", function() {
|
||||||
|
var ctx = new C2S();
|
||||||
|
ctx.rect(200, 200, 400, 400);
|
||||||
|
ctx.clip();
|
||||||
|
ctx.fillStyle = "#000000";
|
||||||
|
ctx.rect(100, 100, 300, 300);
|
||||||
|
var svg = ctx.getSvg();
|
||||||
|
expect(svg.querySelector("clipPath > path").getAttribute("d")).to.not.equal(null);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user