Skip to content

Commit

Permalink
Add clipping support for the Silverlight version.
Browse files Browse the repository at this point in the history
Thanks to maitredede for the patch.

git-svn-id: https://explorercanvas.googlecode.com/svn/trunk@68 fd59bba8-8519-0410-9389-e36bf2bdbbd6
  • Loading branch information
[email protected] committed Sep 28, 2009
1 parent 75e88ec commit 952e68f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions silverlight/excanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// * Patterns are not implemented.
// * Radial gradient are not implemented. The VML version of these look very
// different from the canvas one.
// * Clipping paths are not implemented.
// * Coordsize. The width and height attribute have higher priority than the
// width and height style values which isn't correct.
// * Painting mode isn't implemented.
Expand Down Expand Up @@ -650,9 +649,16 @@ if (!window.CanvasRenderingContext2D) {
]);
};

/******** STUBS ********/
contextPrototype.clip = function() {
// TODO: Implement
if (this.currentPath_.length) {
var clip = this.currentPath_.join(' ');
var canvas = create(this, '<Canvas Width="%1" Height="%2" Clip="%3"/>',
[getRoot(this).width, getRoot(this).height, clip]);
var parent = this.lastCanvas_ || getRoot(this);

parent.children.add(canvas);
this.lastCanvas_ = canvas;
}
};

contextPrototype.createPattern = function() {
Expand Down

0 comments on commit 952e68f

Please sign in to comment.