Rect Stroke Masking Bug?

I’m having a strange problem where the border of my rect vanishes when I apply a mask. But I have been unable to reproduce the problem in a super simple test app, so it must be a particular set of circumstances that results in the problem. I am using middleclass and nesting the rect in a group, but other than that the code is pretty straight-forward. Has anyone experienced a problem like this before, or is there a known limitation to masking that I might be running into?

Thanks,
Adrian [import]uid: 3671 topic_id: 12539 reply_id: 312539[/import]

I have now isolated this bug. The problem is a combination of 2 things: using a mask on a vector object and turning on anti-aliasing in a config file. Below is some sample code demonstrating the problem:

[lua]local group = display.newGroup()

local bgd = display.newRect(0,0,320,480)
group:insert(bgd)
bgd:setFillColor(100,100,100)

local mask = graphics.newMask(“pickScene-mask.png”)
group:setMask(mask)
group.maskX, group.maskY = 160, 240

local testRect = display.newRect(30,30,100,100)
group:insert(testRect)
testRect:setFillColor(200,200,200)
testRect.strokeWidth = 3
testRect:setStrokeColor(0,0,0)[/lua]

Using just that code alone, everything works fine. When I add a config file with anti-aliasing:
[lua]application =
{
content =
{
antialias=true,
},
}[/lua]

The border to the rectangle goes away. Short of making the rectangle a graphic, I do not have any ideas of working around this because I need to use vector circles for my app, which look terrible without anti-aliasing turned on. I would welcome alternative solutions and/or a fix to the problem. [import]uid: 3671 topic_id: 12539 reply_id: 46092[/import]

I have not heard of this problem before. Does it also fail if you don’t add the vector to a group?

Can you email me the png so I can try and duplicate the problem? tom at anscamobile.com

Thanks. [import]uid: 7559 topic_id: 12539 reply_id: 46274[/import]

I have just tested it, and yes, the problem occurs even without a group. [import]uid: 3671 topic_id: 12539 reply_id: 46281[/import]

Looks like a bug and filed it as case #6987.

Thanks for the report and the project files.

-Tom [import]uid: 7559 topic_id: 12539 reply_id: 46293[/import]