-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimeGraphNavigator snap on click feature #181
TimeGraphNavigator snap on click feature #181
Conversation
1a93e81
to
dad5e6b
Compare
this.stateController.snapped = false | ||
} | ||
const moveEnd = () => { | ||
this.mouseIsDown = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 4 space indentation. Comment applies to the whole PR.
Missing ; ?
this.mouseIsDown = false | ||
} | ||
this.addEvent('mouseover', event => { | ||
if(this.stateController.snapped) moveStart(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after if, use {} block for if-clause (with line break, indentation, ;).
this.addEvent('mouseupoutside', moveEnd, this._displayObject); | ||
this.addEvent('mouseup', moveEnd, this._displayObject) | ||
this.addEvent('mouseupoutside', moveEnd, this._displayObject) | ||
document.addEventListener('snap-x-end', moveEnd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ;
const start = BIMath.clamp(start0, min, max) | ||
this.unitController.viewRange = { | ||
start, | ||
end: start + this.unitController.viewRangeLength, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation, unnecessary ,
} | ||
|
||
protected toggleSnappedState = (bool: boolean) => { | ||
this.stateController.snapped = bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
} | ||
|
||
render(): void { | ||
this.rect({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
x: 0, | ||
y: 0 | ||
}, | ||
width: Number(this.unitController.viewRangeLength), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The viewRangeLength is time in nanoseconds. I assume the width should be equal to the chart width in pixels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This has been changed to stateController.canvasDisplayWidth. Had to change some of the logic because of this (line 129).
y: 0 | ||
}, | ||
width: Number(this.unitController.viewRangeLength), | ||
color: 0xe100ff, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, color value is irrelevant since opacity is 0, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, can't see color w/ opacity = 0. This was to visually see the background width. Color has been removed.
c39aae9
to
d018972
Compare
Snap to mouse on time-graph-navigator click Adds background PIXI rectangles to the time-graph-navigator + vertical-navigator components. This rectangle listens for clicks then centers the handler on the mouse and resumes 'dragging' for navigating. Fixes: eclipse-cdt-cloud#97 Signed-off-by: Will Yang <william.yang@ericsson.com>
d018972
to
63558bf
Compare
@PatrickTasse I fixed the indentation, semicolons, and unnecessary commas in both files. I addressed the unique issues in replies to their comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for the improvement.
TimeGraphNavigator and TimeGraphVerticalScrollbar Snap On Click Feature
Adds background PIXI rectangles to the time-graph-navigator + vertical-scrollbar components. This rectangle listens for clicks then centers the handler on the mouse and resumes 'dragging' for navigating.
Fixes: #97
Signed-off-by: Will Yang william.yang@ericsson.com