AliasIO / Raphael.FreeTransform

Free transform tool for Raphaël elements.
http://elbertf.com
362 stars 107 forks source link

How to flip image using raphael free transform.? #139

Open vped opened 10 years ago

vped commented 10 years ago

Isuue: I am using RaphaelJS ans Raphael-Free-Transform for image manipulation in my project. Here I am trying to flip image horzontally. For this I am changing free transform scale value. Image is fliped, but the image gets displaced from its original position and it also gets restored to its original state so we also lose the flip.

$scope.flopImage = function () { if ($scope.currentImage !== null) { var ft = paper.freeTransform($scope.currentImage); ft.attrs.scale.x=-ft.attrs.scale.x; ft.apply(); } }; CASE:2 $scope.flopImage = function () { if ($scope.currentImage !== null) { var ft = paper.freeTransform($scope.currentImage); $scope.currentImage.transform("S-1,1"); ft.apply(); } };