Jump to content
Search Community

Strange GAP

sandesh test
Moderator Tag

Recommended Posts

Hi Jack,

 

I have come across a few issues when using your AutoFitArea class.

I had used your AutoFitArea class for my swf which i am loading it externally.

Since the swf contained mask animations, I attached the swf with the AutoFitArea class and set the calculateVisible = true

But I see that if the mask animations are extending on the left side (x<0), then it strangely leaves a gap on the left as well as the right side of my parent swf

 

I have also seen this problem when i am using your Tweenlite class in conjuction with your AutoFitArea class. It strangely leaves a 1 pixel gap either on the left or right side or on both sides.

Link to comment
Share on other sites

I don't really see a noticeable gap, but it would kind make sense to me if there was a 1 pixel gap in certain circumstances. Let me explain: It's a very tricky thing to do the calculateVisible thing - basically it involves using a BitmapData and draw()-ing your object into the BitmapData and searching for the bounding box defining the areas that aren't completely transparent. So if you have anti-aliasing around the edges, those anti-aliased pixels wouldn't be 100% transparent. Ever seen a curved line zoomed in very close (pixels blown up)? See how the pixels around the edge are anti-aliased so that it doesn't look jagged? Those are the pixels I'm talking about. Unfortunately, I'm not aware of any perfect solution for this that will never end up either slicing off one row/column of pixels that you want or leaving an extra one in that you don't want. There are some hacks I could think of that would add a lot of complexity and weight to the AutoFitArea class and its API, but I think that'd be unwise at this point. I wish I had a simple solution for you.

Link to comment
Share on other sites

Hi Jack,

 

I agree with you that the 1 pixel border gap is hardly noticeable. But you know, that this is my company project and this has come as an issue amongst other things.

So i have to fix it anyhow so that no gap (1 pixel pink border) is visible anywhere.

I tried something like this but it didn't work.

 

Increase the bg width by 2 pixels and shift it on the left by 1 pixel.

In the AutoFitArea constructor, I tried to define the x property to -1, and define the width by extra 2 pixels (like 1282 instead of 1280)

 

BUT NOTHING WORKS....... PLS HELP :(

Is there a possibility of any cheat ?

Link to comment
Share on other sites

It seems like your expansion idea should work - are you positive that you applied it correctly?

 

I wish I had time to throw into building a custom solution for you but I just don't right now. Sorry. If you want to increase the likelihood of getting some suggestions, please create the most simple example as possible with the proposed solution from above in place and post it here so that I can open the FLA, publish it, and see exactly what you're talking about.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...