9-Patch corners are overlapping by 1 pixel

Bugs will be moved here once resolved.

Post » Sat Feb 16, 2013 8:41 pm

Link to .capx file (required!):
https://dl.dropbox.com/u/2175584/Construct2Examples/9SlicePatchBug.capx

Steps to reproduce:
1. Use a 9-Patch
2. To observer best use some transparency

Observed result:
Where the corners meet the sides (which can either tiled or stretched) they overlap by one pixel. Subtle but more noticeable on semi-transparent textures.



Expected result:
Hopefully you can just make them meet up exactly without overlapping.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes (even worse)

Operating system & service pack:
Windows 8

Construct 2 version:
r119 (64-bit)
    
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Sat Feb 16, 2013 9:10 pm

This is actually by design. If the edges meet exactly, it can show seams when scrolling and scaling due to the way rendering at sub-pixel offsets works. I think that's a much more common case than semitransparent images.

Can you work around this by putting the objects on their own layer and setting that layer's opacity, or do you think there needs to be a setting for this?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Feb 16, 2013 10:27 pm

Ideally a setting (for example "exact match" or "overlap").

Can you make these objects always snap to whole pixels to avoid the scrolling/scaling issue?

Also I am using Pixel Rounding, so I assume I wont see seams?

Reason I would ask for the option is because with my current art style I only[b/] want the edges of the boxes to look like glass and for the inside of the grey buttons to look like glass too. I use transparency to achieve this effect (specially when animating this over my assets) but I guess if I can't use 9Patch I can just make all the assets at the pre-set size.

By the way the 9Patch objects render fine in the editor, just not at runtime, is that because at runtime you change the positions?

Thanks for the quick response
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Sun Feb 17, 2013 12:53 am

I had this issue as well when the 9-Patch was released and I wanted to try it
Same thing with an image for an UI with opaque background and semi-transparent outline
I'm not using pixel rounding in this project, but a setting would be nice anyway I think, when relevant
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Mon Feb 18, 2013 12:05 pm

Pixel rounding doesn't solve everything - if you scale the view slightly it can still seam. I'll see if I can add an option for this.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 20, 2013 2:38 pm

Added a setting for this for the next build. Should be fixed then.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 20, 2013 2:42 pm

Sweet :) Thank you, can we expect it soon. Want a badge for one of the first few to download it :)
B
24
S
11
G
5
Posts: 140
Reputation: 5,004


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests