2 * Pixastic Lib - Horizontal flip - v0.1.0
3 * Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/
4 * MIT License [http://www.opensource.org/licenses/mit-license.php]
7 Pixastic.Actions.fliph = {
8 process : function(params) {
9 if (Pixastic.Client.hasCanvas()) {
10 var rect = params.options.rect;
11 var copyCanvas = document.createElement("canvas");
12 copyCanvas.width = rect.width;
13 copyCanvas.height = rect.height;
14 copyCanvas.getContext("2d").drawImage(params.image, rect.left, rect.top, rect.width, rect.height, 0, 0, rect.width, rect.height);
16 var ctx = params.canvas.getContext("2d");
17 ctx.clearRect(rect.left, rect.top, rect.width, rect.height);
19 ctx.drawImage(copyCanvas, -rect.left-rect.width, rect.top, rect.width, rect.height)
20 params.useData = false;
24 } else if (Pixastic.Client.isIE()) {
25 params.image.style.filter += " fliph";
29 checkSupport : function() {
30 return (Pixastic.Client.hasCanvas() || Pixastic.Client.isIE());