Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Camera set_size after onwindowsized #373

Open
jtruher opened this issue Apr 20, 2016 · 2 comments
Open

Camera set_size after onwindowsized #373

jtruher opened this issue Apr 20, 2016 · 2 comments
Labels

Comments

@jtruher
Copy link

jtruher commented Apr 20, 2016

I'm seeing an issue where a camera's size is being reset after an onwindowsized event on mobile. On a home-button press (a suspend, basically) the camera's size and center are being reset, which is a bit of a problem. Adding a guard and a check after the if(!_connected) check in Camera.hx:set_size (L193) seems to fix the problem, but I'm not sure if it's the best way to do things. Here's my guard:

        if(_size != null && size != null) {
          if( size.equals(_size)) {
            return size;
          }
        }

Thoughts?

@ruby0x1
Copy link
Member

ruby0x1 commented Jul 15, 2016

Sorry for the delay, can you elaborate on what what being reset means? The way the size mode works is that you give up some aspects in order to have the sizing handled for you, so I'm not sure I understand the bug symptom as described. If you had a test case that demonstrates it that would be even better, but screenshots/descriptions are good too.

@ruby0x1 ruby0x1 added the camera label Jul 15, 2016
@ruby0x1
Copy link
Member

ruby0x1 commented Jul 15, 2016

ok after more direct discussion, the real issue is that position isn't handled well by the wip size modes. Meaning, if you set pos to a new value, and a resize happens, the center point is adjusted which resets your adjusted position.

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

No branches or pull requests

2 participants