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

UIExplorer: transforms not working with position #232

Open
smallnewer opened this issue Mar 18, 2019 · 5 comments · May be fixed by #234
Open

UIExplorer: transforms not working with position #232

smallnewer opened this issue Mar 18, 2019 · 5 comments · May be fixed by #234
Labels

Comments

@smallnewer
Copy link

smallnewer commented Mar 18, 2019

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

OS: macOS Sierra 10.13.6 (I only have this version)
UIExplorer: downloaded in v0.5.0 tag and here

and i can reproduce this question with :
react-native-macos-cli: 2.0.1
react-native-macos: 0.19.2

Steps to Reproduce

gif

Some Prerequisites

  1. position:absolute with right
  2. any transform
  3. resize the window
@aleclarson aleclarson linked a pull request Mar 18, 2019 that will close this issue
@aleclarson
Copy link
Collaborator

This will be fixed when #234 is merged.

@aleclarson aleclarson added the bug label Mar 18, 2019
@smallnewer
Copy link
Author

Thanks^_^
It's also not working with #234 . Maybe I did something wrong?

My steps

  1. download code from https://github.com/ptmt/react-native-macos/tree/fa28701469188d2b757af84934e13014dacbed9d, which is last commit in Various fixes to RCTView props #234
  2. delete node_modules/react-native-macos/React in my demo project,and copy React(downloaded) to my demo project
  3. build and run ,transform also not working after resize the window。

I'm sure it's #234 code.

key codes:

    render() {
        return (
            <TouchableOpacity 
                style={{position:"absolute", right:100,width:200,height:200,transform:[{translateY:101}],backgroundColor:"red"}}>     
            </TouchableOpacity>
        )
    }

@smallnewer
Copy link
Author

After I delete some code at RCTView.m,It working right:

//  if (!CGSizeEqualToSize(self.bounds.size, oldSize)) {
    [self.layer setNeedsDisplay];
//  }

I don't know if it's appropriate to make such a change.

@aleclarson
Copy link
Collaborator

aleclarson commented Mar 19, 2019

Nice find!

When the frame is updated (eg: by resizing the window), the transform needs to be reapplied.

I've added a new commit to #234, which you should try and let me know if it works. 572a274

If it doesn't work, we can call [self.layer setNeedsDisplay] when _transform is not an identity transform.

@smallnewer
Copy link
Author

It works right . Thanks @aleclarson ! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants