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

WEB-1611: Zoom to Cursor Fix #3562

Merged
merged 3 commits into from
Nov 26, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/viewer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ import { DepthNormalPass } from './modules/pipeline/Passes/DepthNormalPass.js'
import { BasitPass } from './modules/pipeline/Passes/BasitPass.js'
import { ProgressiveAOPass } from './modules/pipeline/Passes/ProgressiveAOPass.js'
import { TAAPass } from './modules/pipeline/Passes/TAAPass.js'
import {
FilterMaterial,
FilterMaterialOptions,
FilterMaterialType
} from './modules/materials/Materials.js'

export {
Viewer,
Expand Down Expand Up @@ -201,7 +206,10 @@ export {
MRTShadedViewPipeline,
MRTPenViewPipeline,
ViewModes,
ViewMode
ViewMode,
FilterMaterial,
FilterMaterialType,
FilterMaterialOptions
}

export type {
Expand Down
6 changes: 2 additions & 4 deletions packages/viewer/src/modules/Viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ export class Viewer extends EventEmitter implements IViewer {
const cs = []
let pt = obj
do {
if ((pt = Object.getPrototypeOf(pt))) cs.push(pt.constructor || null)
if ((pt = Object.getPrototypeOf(pt))) cs.push(pt.constructor.name || null)
} while (pt !== null)
return cs.map(function (c) {
return c ? c.toString().split(/\s|\(/)[1] : null
})
return cs
}

public createExtension<T extends Extension>(type: Constructor<T>): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ export class SmoothOrbitControls extends SpeckleControls {
* such that they progress across their allowed ranges in sync.
*/
adjustOrbit(deltaTheta: number, deltaPhi: number, deltaZoom: number) {
deltaZoom
this._radiusDelta
const { theta, phi, radius } = this.goalSpherical

Expand Down Expand Up @@ -979,13 +978,14 @@ export class SmoothOrbitControls extends SpeckleControls {

protected onWheel = (event: WheelEvent) => {
const x =
((event.clientX - this._container.clientLeft) / this._container.clientWidth) * 2 -
((event.clientX - this._container.offsetLeft) / this._container.offsetWidth) * 2 -
1

const y =
((event.clientY - this._container.clientTop) / this._container.clientHeight) *
((event.clientY - this._container.offsetTop) / this._container.offsetHeight) *
-2 +
1

this.zoomControlCoord.set(x, y)

const deltaZoom =
Expand Down
Loading