aboutsummaryrefslogtreecommitdiff
path: root/ui/src/frontend/drag/outer_drag_strategy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/frontend/drag/outer_drag_strategy.ts')
-rw-r--r--ui/src/frontend/drag/outer_drag_strategy.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/src/frontend/drag/outer_drag_strategy.ts b/ui/src/frontend/drag/outer_drag_strategy.ts
index 648b50d4b..f8269fcf0 100644
--- a/ui/src/frontend/drag/outer_drag_strategy.ts
+++ b/ui/src/frontend/drag/outer_drag_strategy.ts
@@ -11,16 +11,19 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+import {
+ HighPrecisionTime,
+} from '../../common/high_precision_time';
import {DragStrategy} from './drag_strategy';
export class OuterDragStrategy extends DragStrategy {
private dragStartPx = 0;
onDrag(x: number) {
- const dragBeginTime = this.timeScale.pxToTime(this.dragStartPx);
- const dragEndTime = this.timeScale.pxToTime(x);
- const tStart = Math.min(dragBeginTime, dragEndTime);
- const tEnd = Math.max(dragBeginTime, dragEndTime);
+ const dragBeginTime = this.map.pxToHpTime(this.dragStartPx);
+ const dragEndTime = this.map.pxToHpTime(x);
+ const tStart = HighPrecisionTime.min(dragBeginTime, dragEndTime);
+ const tEnd = HighPrecisionTime.max(dragBeginTime, dragEndTime);
super.updateGlobals(tStart, tEnd);
}