When cloning canvas (in toDataURL, for example) make sure to clone clipTo (clipping function) property as well.

This commit is contained in:
kangax 2011-05-26 09:03:11 -04:00
parent dcaee8bf0c
commit 1d9247ab3a
4 changed files with 7 additions and 5 deletions

View file

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Demos</title>
<title>Fabric.js demos</title>
<link rel="stylesheet" href="../lib/master.css" type="text/css">
</head>
<body>
@ -13,8 +13,8 @@
</ul>
<div id="bd-wrapper">
<ul>
<li style="margin-bottom:5px"><a href="ladybug/index.html">Ladybugs</a></li>
<li style="margin-bottom:5px"><a href="cross/index.html">Crosses</a></li>
<li style="margin-bottom:5px"><a href="ladybug/index.html">Sliding ladybugs</a></li>
<li style="margin-bottom:5px"><a href="cross/index.html">Animating crosses (custom class)</a></li>
</ul>
</div>
</body>

3
dist/all.js vendored
View file

@ -6011,7 +6011,8 @@ fabric.util.animate = animate;
el.height = this.getHeight();
var clone = this.__clone || (this.__clone = new fabric.Element(el));
clone.clipTo = this.clipTo;
return clone.loadFromJSON(JSON.stringify(this.toJSON()), function () {
if (callback) {
callback(clone);

View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "0.2.6" };
var fabric = fabric || { version: "0.2.7" };
/**
* Wrapper around `console.log` (when available)

View file

@ -2217,6 +2217,7 @@
// cache
var clone = this.__clone || (this.__clone = new fabric.Element(el));
clone.clipTo = this.clipTo;
return clone.loadFromJSON(JSON.stringify(this.toJSON()), function () {
if (callback) {