MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / update

Method update

source/MRViewer/MRTouchesController.cpp:151–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151bool 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
179std::optional<Vector2f> TouchesController::MultiInfo::getPosition( Finger fing ) const
180{

Callers 3

onTouchStart_Method · 0.45
onTouchMove_Method · 0.45
onTouchEnd_Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected