bluecadet/Cinder-BluecadetViews

TouchManager : set app size for gesture plugin

Swiley opened this issue · 2 comments

Ran into an issue when I was adding GW into CT - the gesture event positions were being based off the size of the window instead of the app size.

I think we want to add something like this in BaseApp.cpp setup(), so that when the plugin is initialized it knows what the true app size is (current order of calls sets it to the window size).

// Set app size of touch manager (for gesture plugins)
touch::TouchManager::getInstance()->setAppSize(ScreenLayout::getInstance()->getAppSize());

and in TouchManager.h
void setAppSize(const ci::vec2& appSize) { mAppSize = appSize; }

I tried to implement it in the sample (it's working in the project I have going) - but when there is no appSettings.json the BaseApp::setup() call for ScreenLayout::getInstance()->getDisplayWidth() is returning 1857 (I think it should be returning 1080).

This is where I left off - just wanted to track these notes here as I don't have time to address it at the moment.

Good points. I thought I fixed something similar a while back (e.g. #47). You're working on the latest branch, right? How urgent is this for you, @Swiley ? I may have 5 min to chat later tonight or we can discuss on Monday.

I have it working in the app I'm dev'ing on, so it's not incredibly urgent. Just wanted to make sure the revisions got relayed.