uikit
uikit copied to clipboard
feat: add transform property for xyz at once
Added transform properties to set rotation, and translate in XYZ axis with a single line
Example
Before:
<Container
transformRotateX={-5}
transformRotateY={-5}
transformRotateZ={-5}
transformTranslateX={7}
transformTranslateY={2}
transformTranslateZ={10}
/>
After:
<Container
transformRotate={[-5, -5, -5]}
transformTranslate={[7, 2, 10]}
/>
Thanks for the PR The problem with this implementation is unexpected behavior for
<Container transformTranslation={[1,2,3]} transformTranslationX={100} />
To implement the expected behavior for this case you want to create a new property transformation that extends the transformAliasPropertyTransformation one provide that to useGetBatchedProperties. The new property transformation should then, convert transformationTransformation tosetProperty("transformationTransformationX", p[0]); etc.
@bbohlender why unexpected? jsx has guaranteed order. this would work in fiber/react
<mesh position={[1,2,3]} position-x={2} /> // position === [2,2,3]
Yes, but the current implementation in the PR turns
<Container transformTranslation={[1,2,3]} transformTranslationX={100} />
into transformTranslation={[1,2,3]}
I already described how to preserve the order of jsx properties when applying them :)
@wrong7 Was my comment regarding the unexpected behavior clear? If you don't have time, I can also take over this PR
Yes it was clear, sorry I didn't update the PR. I still haven't got used to the code and I don't have much free time to make it, so you can take over
I'll close this for house keeping. If this feature is important, let's create an issue for it and prioritize it ;-)