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

"Align to pixel grid" causes infinite loops #10

Open
WestonThayer opened this issue Aug 18, 2016 · 0 comments
Open

"Align to pixel grid" causes infinite loops #10

WestonThayer opened this issue Aug 18, 2016 · 0 comments
Labels

Comments

@WestonThayer
Copy link
Owner

Illustrator's "align to pixel grid" feature screws up Blok's auto layout. It can cause auto layout to keep running layout infinitely, effectively hanging Illustrator. Workaround is to turn that Illustrator feature off for now.

Problem 1

Align to pixel grid nudges things around a bit after a layout (especially with Area Text). That triggers a selection changed event and Bloks sees new dimensions. Resizing often isn't allowed, so Bloks undoes the change. Align to pixel grid then nudges things around a bit, and the infinite loop continues.

  • We can't detect when align to pixel grid is on since PageItem.pixelAligned never seems to work
    • On the native side, maybe AIArtSuite::IsPixelPerfect or AIDocumentSuite::GetDocumentPixelPerfectStatus() will give us the true value
  • Can't solve it by detecting an infinite loop, we'd reject real user changes

Problem 2

With flexibility turned on, sometimes the correct layout leaves art with fractional widths/heights. Align to pixel grid fixes this, but then we hit the same infinite loop.

  • Probably shouldn't try to solve this by attempting to round the same way align to pixel grid does. How would we know what algorithm to match? Too many edge cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant