fix: correct counter axis logic in getDirection function#232
Open
lordke wants to merge 1 commit intoGLips:mainfrom
Open
fix: correct counter axis logic in getDirection function#232lordke wants to merge 1 commit intoGLips:mainfrom
lordke wants to merge 1 commit intoGLips:mainfrom
Conversation
cf1c7cd to
0966434
Compare
The getDirection function was incorrectly returning the same direction for both primary and counter axes. In flexbox layout: - When mode is 'row': primary axis is horizontal, counter axis should be vertical - When mode is 'column': primary axis is vertical, counter axis should be horizontal This fix ensures the counter axis returns the perpendicular direction to the primary axis.
0966434 to
88eb92c
Compare
Owner
|
Nice find @lordke—this definitely seems like a bug to me. Can you put together a public Figma design that demonstrates the issue? Would love to test the output before and after the fix before I merge it. |
Owner
|
Hey @lordke, just wanted to follow up on the above—like I said this does seem like a bug to me, but I put together some tests and haven't been able to identify the specific issue. All my designs seem to be output correctly in HTML when translated through the MCP. Do you have a broken design you can share? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Description
The
getDirectionfunction has incorrect logic for the counter axis. Currently, the counter axis returns the same direction as the primary axis, which is incorrect in flexbox layout systems.Fix Details
This PR corrects the counter axis logic:
modeis"row": primary axis is horizontal, counter axis should be verticalmodeis"column": primary axis is vertical, counter axis should be horizontalFiles Changed
src/transformers/layout.ts: Fixed the return values for counter axis ingetDirectionfunctionBefore/After Comparison
Before (incorrect):
After (correct):