Skip to content
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

Optimize animations by reducing debounce time #3244

Merged
merged 2 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
- Unselecting a folder in Presentation Mode leads to console error [#3215](https://github.com/MaibornWolff/codecharta/pull/3215)
- Fix Shrunken FileExplorer's file list on small displays [#3235](https://github.com/MaibornWolff/codecharta/pull/3235)
- Fix various margin problems in the UI [#3226](https://github.com/MaibornWolff/codecharta/pull/3226)
- Fix bumpy animations when moving/turning the map, hover buildings (showing labels and edges) [#3244](https://github.com/MaibornWolff/codecharta/pull/3244)

### Chore 👨‍💻 👩‍💻

Expand Down
Expand Up @@ -16,7 +16,7 @@ export class CodeMapArrowService implements OnDestroy {
private map: Map<string, Node>
private VERTICES_PER_LINE = 5
private arrows: Object3D[] = new Array<Object3D>()
private HIGHLIGHT_BUILDING_DELAY = 15
private HIGHLIGHT_BUILDING_DELAY = 1
private debounceCalculation: (hoveredBuilding: CodeMapBuilding) => void = debounce(
(hoveredBuilding: CodeMapBuilding) => this.resetEdgesOfBuildings(hoveredBuilding),
this.HIGHLIGHT_BUILDING_DELAY
Expand Down
Expand Up @@ -99,15 +99,15 @@ export class CodeMapMouseEventService implements OnDestroy {
}

start() {
this.threeRendererService.renderer.domElement.addEventListener("mousemove", debounce(this.onDocumentMouseMove, 60))
this.threeRendererService.renderer.domElement.addEventListener("mousemove", debounce(this.onDocumentMouseMove, 1))
this.threeRendererService.renderer.domElement.addEventListener("mouseup", event => this.onDocumentMouseUp(event))
this.threeRendererService.renderer.domElement.addEventListener("mousedown", event => this.onDocumentMouseDown(event))
this.threeRendererService.renderer.domElement.addEventListener("dblclick", () => this.onDocumentDoubleClick())
this.threeRendererService.renderer.domElement.addEventListener("mouseleave", event => this.onDocumentMouseLeave(event))
this.threeRendererService.renderer.domElement.addEventListener("mouseenter", () => this.onDocumentMouseEnter())
this.threeRendererService.renderer.domElement.addEventListener(
"wheel",
debounce(() => this.threeRendererService.render(), 60)
debounce(() => this.threeRendererService.render(), 1)
)
this.viewCubeMouseEvents.subscribe("viewCubeEventPropagation", this.onViewCubeEventPropagation)
}
Expand Down