Skip to content

Commit

Permalink
Issue/#52 (#45)
Browse files Browse the repository at this point in the history
* Revert "Merge pull request #10 from /issues/52-cursor-overview-offset"

This reverts commit 23be40c, reversing
changes made to 3a2a62a.

* Only Offset Overview Cursor Selection When Sidebar

Cursor in overview is offset by Sidebar Width even when Sidebar is minimized
Change-Id: Id6c1affc8fbb8a1a15f1d98eb82028b24d4a1b38
  • Loading branch information
ALevansSamsung authored Oct 12, 2023
1 parent 45531e0 commit c591396
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ui/src/frontend/overview_timeline_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {

import {
OVERVIEW_TIMELINE_NON_VISIBLE_COLOR,
SIDEBAR_WIDTH,
TRACK_SHELL_WIDTH,
getCssStr,
} from './css_constants';
Expand Down Expand Up @@ -173,20 +172,17 @@ export class OverviewTimelinePanel extends Panel {
if (this.gesture === undefined || this.gesture.isDragging) {
return;
}
(e.target as HTMLElement).style.cursor = this.chooseCursor(e.x);
(e.target as HTMLElement).style.cursor = this.chooseCursor(e.offsetX);
}

private chooseCursor(x: number) {
if (this.timeScale === undefined) return 'default';
const [vizStartPx, vizEndPx] =
const [startBound, endBound] =
OverviewTimelinePanel.extractBounds(this.timeScale);
const offset = globals.hideSidebar ? 0 : SIDEBAR_WIDTH;
const startBound = vizStartPx - 1 + offset;
const endBound = vizEndPx + offset;
if (OverviewTimelinePanel.inBorderRange(x, startBound) ||
OverviewTimelinePanel.inBorderRange(x, endBound)) {
return 'ew-resize';
} else if (x < offset + TRACK_SHELL_WIDTH) {
} else if (x < TRACK_SHELL_WIDTH) {
return 'default';
} else if (x < startBound || endBound < x) {
return 'crosshair';
Expand Down

0 comments on commit c591396

Please sign in to comment.