Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stroke getting cut off #100

Open
kheftel-old opened this issue Nov 20, 2013 · 7 comments
Open

Stroke getting cut off #100

kheftel-old opened this issue Nov 20, 2013 · 7 comments

Comments

@kheftel-old
Copy link

Hi,

Forgive me if I missed something, but I have been playing around with Flump and noticed it sometimes cuts off part of my sprite's stroke.

I.e. here is a simple sprite in Flash:
image
And here is what it looks like in Flump:
image

You can see that a pixel or two of the bottom and right edges have been shaved off, making it not round.

This is of course just a test sprite, I'm testing Flump out to see if I can use it to enable a Flash-based vector asset-creation workflow in a Starling mobile game I'm working on.

Any help would be appreciated, thanks!

@thejustinwalsh
Copy link
Contributor

I've run into this issue in flash before when attempting to position MovieClips that have a stroke applied.

The fun part is that when you ask the Sprite/MovieClip for it's width and height it returns a value that does not include the stroke. Instead of figuring out how to get the appropriate width and height we just killed the stroke and used shapes to fake it. This is obviously not ideal, but when you don't have time to fix it, hack it, right?

I think the solution lies in asking the shape itself for it's stroke weight then padding the clip with extra space.

@tconkling
Copy link
Owner

DisplayObject.getBounds - which we use for determining display object size in the exporter - is supposed to take stroke sizes into account, but this has been a source of frustration for me in the past as well.

We may be able to solve this issue by updating Flump's SwfTexture class to render stroked objects into a bitmap and do pixel-perfect bounds testing there. This is currently being done for objects that have filters applied to them, for similar reasons (filter-modified bounds aren't reported by Flash).

This isn't something I have the time to dive into at the moment but I'm happy to assist if you're interested in taking it on. It should be fairly straight-forward.

@kpatelPro
Copy link
Contributor

Yes, if stroke detection is added to SwfTexture.hasPotentiallySizeAlteringFilters(), I believe that would take care of it.

@th3d0g
Copy link

th3d0g commented Nov 22, 2013

I'm also having this issue. Can anyone recommend a solution (even if temporary)?

@tconkling
Copy link
Owner

I recommended one two messages up from yours :)

To hack this in temporarily, you could try modifying SwfTexture.hasPotentiallySizeAlteringFilters to just always return true.

@markknol
Copy link

Is this hack implemented, also for flipbooks? Because those get cropped too with thick borders.

@tconkling
Copy link
Owner

Not implemented currently - it should be straight-forward? I'm not able to
get to it at the moment as I'm crunching on my game.

On Wed, Jul 30, 2014 at 1:02 AM, Mark Knol [email protected] wrote:

Is this hack implemented, also for flipbooks? Because those get cropped
too with thick borders.


Reply to this email directly or view it on GitHub
#100 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants