MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onMouseDragged

Method onMouseDragged

Engine/source/Verve/GUI/VTimeLineControl.cpp:150–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void VTimeLineControl::onMouseDragged( const GuiEvent &pEvent )
151{
152 Parent::onMouseDragged( pEvent );
153
154 if ( !mIsController || !mController || mController->isPlaying() )
155 {
156 return;
157 }
158
159 // Calculate Time.
160 const Point2I hitPoint = globalToLocalCoord( pEvent.mousePoint );
161 const S32 time = mClamp( toTime( hitPoint.x ), 0, mController->getDuration() );
162
163 if ( pEvent.modifier & SI_SHIFT )
164 {
165 if ( mSelection.Active )
166 {
167 // Update Selection.
168 mSelection.EndTime = time;
169
170 // Callback.
171 Con::executef( this, "onSelectionUpdate" );
172 }
173 }
174 else
175 {
176 if ( mSelection.Active )
177 {
178 // Selection Invalid.
179 mSelection.Active = false;
180
181 // Callback.
182 Con::executef( this, "onSelectionUpdate" );
183 }
184 }
185
186 if ( pEvent.modifier & SI_CTRL )
187 {
188 // Set Time, No Reset.
189 mController->setTime( time );
190 }
191 else if ( !mSelection.Active )
192 {
193 // Reset.
194 mController->reset( time );
195 }
196}
197
198void VTimeLineControl::onRightMouseDown( const GuiEvent &pEvent )
199{

Callers

nothing calls this directly

Calls 7

onMouseDraggedFunction · 0.85
mClampFunction · 0.85
executefFunction · 0.85
isPlayingMethod · 0.45
getDurationMethod · 0.45
setTimeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected