fix update after dim change and constant axes size

master
howard 2021-04-26 12:48:02 -07:00
parent 5bde0fb599
commit e23985a80f
3 changed files with 5 additions and 3 deletions

View File

@ -364,6 +364,7 @@ function render() {
this.camera.left = -canvas.clientWidth / canvas.clientHeight; this.camera.left = -canvas.clientWidth / canvas.clientHeight;
this.camera.right = canvas.clientWidth / canvas.clientHeight; this.camera.right = canvas.clientWidth / canvas.clientHeight;
this.camera.updateProjectionMatrix(); this.camera.updateProjectionMatrix();
console.log(this.camera.zoom)
this.controls.handleResize() this.controls.handleResize()
Object.assign(this.rect, this.canvas.getBoundingClientRect().toJSON()) Object.assign(this.rect, this.canvas.getBoundingClientRect().toJSON())
@ -371,7 +372,7 @@ function render() {
} }
if (this.axes) this.axes.resize(this.camera.zoom) if (this.axes) this.axes.resize(this.camera.zoom, this.canvas.clientHeight)
this.renderer.render(this.obj3d, this.camera); this.renderer.render(this.obj3d, this.camera);

View File

@ -32,8 +32,8 @@ class AxesHelper extends THREE.Object3D {
return this return this
} }
resize(zoom) { resize(zoom, canvH) {
const scale = this.initialZoom / zoom const scale = this.initialZoom / zoom * 1000/canvH
for (let i = 0; i < this.children.length; i++) { for (let i = 0; i < this.children.length; i++) {
this.children[i].setLength( this.children[i].setLength(

View File

@ -179,6 +179,7 @@ export function updateDim(c_id) {
this.scene.render() this.scene.render()
ev_focus.target.blur() ev_focus.target.blur()
this.updateBoundingSpheres() this.updateBoundingSpheres()
this.hasChanged = true
} else if (e.key == 'Escape') { } else if (e.key == 'Escape') {
ev_focus.target.textContent = value ev_focus.target.textContent = value
getSelection().empty() getSelection().empty()