Getting weird results when masking a sprite

Hey there, I am getting a strange bug when I try to mask a card (from spritesheet) with a rounded corners rectangle

I am using the Peach Pellen’s approach on her tutorial, but simply added a mask and the image crashes.

I’ve tried another shapes on the mask and always they look skewed. Note that the rounded corners are skewed and stretched.

[lua]display.setStatusBar( display.HiddenStatusBar )

require ‘sprite’

local cardsheet = sprite.newSpriteSheet(“tileSheet2.png”, 145, 191)

local cardset = sprite.newSpriteSet (cardsheet, 1, 4)
sprite.add (cardset, “buggyBuggy”, 3, 1, 300, 0)

local cardFront = sprite.newSprite (cardset)
cardFront.x = 160
cardFront.y = 200

cardFront:prepare(“buggyBuggy”)

local buggyMask = graphics.newMask( ‘mask1.png’ )

cardFront:setMask(buggyMask)[/lua]

Here are the images I am working with.

mask1.png

spriteSheet2.png

Corona Simulator

[import]uid: 115838 topic_id: 26298 reply_id: 326298[/import]

Here is the image:

THIS WORKS

THIS DOES NOT

[import]uid: 115838 topic_id: 26298 reply_id: 106593[/import]

Just figured something. The size of the mask matters. I tried with a 256x256 black background with the card shape and it worked.

Then I cropped the image to the minimum to get only the card shape and it started bugging again.

Is that the cause of the distortion? [import]uid: 115838 topic_id: 26298 reply_id: 106592[/import]