| 149 | } |
| 150 | |
| 151 | bool TouchesController::MultiInfo::update( TouchesController::Info info, bool remove ) |
| 152 | { |
| 153 | Info* thisInfoPtr{nullptr}; |
| 154 | if ( info.id == info_[0].id ) |
| 155 | thisInfoPtr = &info_[0]; |
| 156 | else if ( info.id == info_[1].id ) |
| 157 | thisInfoPtr = &info_[1]; |
| 158 | |
| 159 | if ( remove ) |
| 160 | { |
| 161 | if ( !thisInfoPtr ) |
| 162 | return false; |
| 163 | thisInfoPtr->id = -1; |
| 164 | return true; |
| 165 | } |
| 166 | if ( !thisInfoPtr && info_[1].id == -1 ) |
| 167 | { |
| 168 | if ( info_[0].id == -1 ) |
| 169 | thisInfoPtr = &info_[0]; |
| 170 | else |
| 171 | thisInfoPtr = &info_[1]; |
| 172 | } |
| 173 | if ( !thisInfoPtr ) |
| 174 | return false; |
| 175 | *thisInfoPtr = std::move( info ); |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | std::optional<Vector2f> TouchesController::MultiInfo::getPosition( Finger fing ) const |
| 180 | { |
no outgoing calls
no test coverage detected