Commit 50ea6d87 authored by legoc's avatar legoc
Browse files

Added call to onResize() in UnitCellView3D.init() to solve bad initial projection

parent 4a23d395
......@@ -102,8 +102,10 @@ class UnitCellView3D {
viewManager.addView(this);
this.calcUC();
// Update the projection with initial width and height.
this.onResize(this._width, this._height);
// slot for updated unit cell infos
// Slot for updated unit cell infos.
PubSub.subscribe('redraw-unitcell', (message, values) => {
for(let value in values) {
if (value === "atomnames") {
......@@ -231,6 +233,7 @@ class UnitCellView3D {
* On resize event.
*/
onResize(width, height) {
this._scene.userData.camera.aspect = width / height;
this._scene.userData.camera.updateProjectionMatrix();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment