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.right = canvas.clientWidth / canvas.clientHeight;
this.camera.updateProjectionMatrix();
console.log(this.camera.zoom)
this.controls.handleResize()
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);

View File

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

View File

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