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

Custom components ignore Layout's defaultItemAlignment and defaultItemPadding #111

Open
asharma-ml opened this issue Mar 11, 2020 · 2 comments
Assignees

Comments

@asharma-ml
Copy link

asharma-ml commented Mar 11, 2020

When adding a custom component to a Layout, the component ignores the default item alignment and padding. Other items added to the Layout are correctly rendered with the defaults.

      <MSC.GridLayout
        name={"GridLayout1"}
        columns={0}
        rows={0}
        skipInvisibleItems={false}
        defaultItemAlignment={"top-left"}
        defaultItemPadding={[0.03, 0.03, 0.03, 0.03]}
        size={[0, 0]}
      >
        <MSC.Image
          name={"Image1"}
          texCoords={[[0, 1], [1, 1], [1, 0], [0, 0]]}
          color={[1, 1, 1, 1]}
          opaque={false}
          ui={false}
          width={0.2}
          height={0.2}
        />
        <MSC.Content
          localPosition= {[0, 0, 0]}
          localRotation= {[0, 0, 0, 1]}
          localScale= {[1, 1, 1]}
        >
        {/* CUSTOM COMPONENT: */}
        <Comp/>
        {/* CUSTOM COMPONENT: */}
        </MSC.Content>
      </MSC.GridLayout>

GridTest.zip

@grozdanov grozdanov self-assigned this Mar 12, 2020
@asharma-ml
Copy link
Author

Wrapping the custom component in a View does adhere to the default alignment and paddings:

        <MSC.View
          localPosition= {[0, 0, 0]}
          localRotation= {[0, 0, 0, 1]}
          localScale= {[1, 1, 1]}
        >
        {/* CUSTOM COMPONENT: */}
        <Comp/>
        {/* CUSTOM COMPONENT: */}
        </MSC.View>

@grozdanov
Copy link
Contributor

MXSCOMP-202

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

2 participants