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

app_width/height not correct depending on portrait/landscape #41

Closed
malkomalko opened this issue Apr 16, 2014 · 5 comments
Closed

app_width/height not correct depending on portrait/landscape #41

malkomalko opened this issue Apr 16, 2014 · 5 comments

Comments

@malkomalko
Copy link
Contributor

title says it all.. going to look at fixing that now

@twerth
Copy link
Member

twerth commented Apr 16, 2014

Yeah, UIScreen.mainScreen.bounds always shows portrait values regardless. However, in stylesheets we can fix that for app_width, screen_width, etc. I assume you're talking about in stylesheets?

@malkomalko
Copy link
Contributor Author

module RubyMotionQuery
  class Stylesheet

    def app_width
      landscape? ? app_size.width : app_size.height
    end

    def app_height
      landscape? ? app_size.height : app_size.width
    end

  end
end

correct, the above seemed to work

@twerth
Copy link
Member

twerth commented Apr 16, 2014

yup, exactly, feel free to do a PR (become a contributor :-)). Or I'm happy to do it. screed_width/screen_height too please.

@malkomalko
Copy link
Contributor Author

I'll hook this up and send in a PR.

@malkomalko
Copy link
Contributor Author

closing this: pull request here #42

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