| 148 | } |
| 149 | |
| 150 | void 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 | |
| 198 | void VTimeLineControl::onRightMouseDown( const GuiEvent &pEvent ) |
| 199 | { |
nothing calls this directly
no test coverage detected