AliasIO/Raphael.FreeTransform

How to flip image using raphael free transform.?

Opened this issue · 0 comments

vped commented

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();
}
};