alpha icon indicating copy to clipboard operation
alpha copied to clipboard

Camera set_size after onwindowsized

Open jtruher opened this issue 8 years ago • 2 comments

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?

jtruher avatar Apr 20 '16 22:04 jtruher

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 avatar Jul 15 '16 00:07 ruby0x1

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.

ruby0x1 avatar Jul 15 '16 01:07 ruby0x1