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

Use actual width -- not potentially overridden width -- on smallest artboard #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinschaul
Copy link
Contributor

Fixes a bug with the logic that automatically displays the narrowest
artboard when the graphic is displayed at an even narrower width.

If the smallest artboard's width is say 300px, but the artboard's name
sets its min-width to 280px (using the :MIN_WIDTH artboard name syntax),
the previous logic would set an inline CSS style of max-width to 280px.
This PR fixes that by adjusting the getArtboardWidthRange() function to
-- for the smallest artboard -- set the width range to [0, actualWidth]
rather than the potentially overridden width. Since the actual width of
the artboard in this example is 300px, the inline CSS style becomes
max-width: 300px as expected.

Please let me know if this explanation is unclear, and I can create and
send an example .ai file and the output with and without this bugfix.

Fixes a bug with the logic that automatically displays the narrowest
artboard when the graphic is displayed at an even narrower width.

If the smallest artboard's width is say 300px, but the artboard's name
sets its min-width to 280px (using the :MIN_WIDTH artboard name syntax),
the previous logic would set an inline CSS style of max-width to 280px.
This PR fixes that by adjusting the getArtboardWidthRange() function to
-- for the smallest artboard -- set the width range to [0, actualWidth]
rather than the potentially overridden width. Since the actual width of
the artboard in this example is 300px, the inline CSS style becomes
max-width: 300px as expected.

Please let me know if this explanation is unclear, and I can create and
send an example .ai file and the output with and without this bugfix.
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

Successfully merging this pull request may close these issues.

1 participant