Skip to content

Commit

Permalink
Typings tweak and zooming improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Mihailik authored and Oleg Mihailik committed Sep 27, 2023
1 parent 5a32cf7 commit 3649ee6
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,8 @@ function atlas(invokeType) {
* enableDamping: boolean;
* autoRotate: boolean;
* autoRotateSpeed: number;
* listenToKeyEvents(element);
* zoomToCursor?: boolean;
* listenToKeyEvents(element: { addEventListener: Function });
* saveState(): void;
* reset(): void;
* dispose(): void;
Expand All @@ -1246,6 +1247,7 @@ function atlas(invokeType) {
*/
function initControls(OrbitControls) {
let controls = new OrbitControls(camera, host);
controls.zoomToCursor = true;
controls.addEventListener('start', function () {
pauseRotation();
});
Expand Down Expand Up @@ -1720,7 +1722,7 @@ function atlas(invokeType) {
unknownsPerSecElem, unknownsTotalElem;

let flashStatsHidden = true;
const bottomStatusLine = /** @type {HTMLDivElement & { update(outcome, labelsOutcome) }} */(elem('div', {
const bottomStatusLine = /** @type {HTMLDivElement & { update: typeof update }} */(elem('div', {
style: `
grid-row: 5;
color: #cc903b;
Expand Down Expand Up @@ -1804,6 +1806,24 @@ function atlas(invokeType) {
bottomStatusLine.update = update;
return bottomStatusLine;

/**
* @param {{
* flashes: number,
* likes: number,
* posts: number,
* reposts: number,
* follows: number,
* unknowns: number,
* unknownsTotal: number
* }} outcome
* @param {{
* labelCount: number,
* hitTestCount: number,
* avatarImages: number,
* avatarRequestCount: number,
* allCachedAvatars: number
* }} labelsOutcome
*/
function update(outcome, labelsOutcome) {
labelsElem.textContent = labelsOutcome.labelCount.toString();
hitTestElem.textContent = labelsOutcome.hitTestCount.toString();
Expand Down

0 comments on commit 3649ee6

Please sign in to comment.