Skip to content

Commit

Permalink
fixed nglviewer#549 (THREE.Box3: .getSize() target is now required)
Browse files Browse the repository at this point in the history
  • Loading branch information
arose committed Aug 7, 2018
1 parent b6ed4b8 commit aba3b2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/scripts/interactive/ligand-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function showLigand (sele) {
neighborSele = expandedSele

var sview = s.getView(new NGL.Selection(sele))
pocketRadius = Math.max(sview.boundingBox.getSize().length() / 2, 2) + 5
pocketRadius = Math.max(sview.boundingBox.getSize(new NGL.Vector3()).length() / 2, 2) + 5
var withinSele2 = s.getAtomSetWithinSelection(new NGL.Selection(sele), pocketRadius + 2)
var neighborSele2 = '(' + withinSele2.toSeleString() + ') and not (' + sele + ') and polymer'

Expand Down Expand Up @@ -398,7 +398,7 @@ var clipNearRange = createElement('input', {
type: 'range', value: 0, min: 0, max: 10000, step: 1
}, { top: getTopPosition(16), left: '12px' })
clipNearRange.oninput = function (e) {
var sceneRadius = stage.viewer.boundingBox.getSize().length() / 2
var sceneRadius = stage.viewer.boundingBox.getSize(new NGL.Vector3()).length() / 2

var f = pocketRadius / sceneRadius
var v = parseFloat(e.target.value) / 10000 // must be between 0 and 1
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/representation/molecularsurface-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ stage.loadFile('rcsb://4hhb').then(function (o) {
color: 'lime',
opacity: 0.7,
wireframe: true,
clipRadius: sview.boundingBox.getSize().length() / 2 + 5,
clipRadius: sview.boundingBox.getSize(new NGL.Vector3()).length() / 2 + 5,
clipCenter: sview.center
})

Expand Down
2 changes: 1 addition & 1 deletion src/representation/molecularsurface-representation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class MolecularSurfaceRepresentation extends StructureRepresentation {
if (!info.molsurf || info.sele !== sview.selection.string) {
if (this.filterSele) {
const sviewFilter = sview.structure.getView(new Selection(this.filterSele))
const bbSize = sviewFilter.boundingBox.getSize(new Vector3)
const bbSize = sviewFilter.boundingBox.getSize(new Vector3())
const maxDim = Math.max(bbSize.x, bbSize.y, bbSize.z)
const asWithin = sview.getAtomSetWithinPoint(sviewFilter.center, (maxDim / 2) + 6.0)
sview = sview.getView(
Expand Down

0 comments on commit aba3b2d

Please sign in to comment.