Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
alzatin committed Oct 18, 2020
1 parent 12d428a commit 0d0b2d8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions bundle 2.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd C:\Users\Bar\Documents\GitHub\JSxCAD\ui\v1
npm run didYouRunBootstrapMaslowRollup

pause
30 changes: 15 additions & 15 deletions src/js/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class Display {

}

/**
/**
* Updates the camera position
*/
update(){
Expand All @@ -202,7 +202,7 @@ export default class Display {
this.renderer(this.options)
}

/**
/**
* Handles resizing the 3D viewer when the window resizes.
*/
onWindowResize() {
Expand All @@ -213,17 +213,17 @@ export default class Display {

/**
* Zooms the camera to fit target bounds on the screen.
* @param {array} bounds - An array of some sort...this comment should be updated.
* @param {object} bounds -bounds from a solid
*/
zoomCameraToFit(bounds){

// reset camera position
this.state.camera.position[0] = 0
this.state.camera.position[1] = -5*Math.max(...bounds.max)
this.state.camera.position[2] = 5*Math.max(...bounds.max)

// re set grid to fit solid
this.gridSizeX = 10*Math.max(...bounds.max)
this.gridSizeY = 10*Math.max(...bounds.max)

//update camera & render
this.update()
}

Expand Down Expand Up @@ -294,15 +294,15 @@ export default class Display {
{ // grid data
// the choice of what draw command to use is also data based
visuals: {
drawCmd: 'drawGrid',
show: true,
color: [0, 0, 0, .8],
subColor: [0, 0, 0, 0.1],
fadeOut: false,
transparent: true
},
size: [this.gridSizeX, this.gridSizeY],
ticks: [10, 1]
drawCmd: 'drawGrid',
show: true,
color: [0, 0, 0, .8],
subColor: [0, 0, 0, 0.1],
fadeOut: false,
transparent: true
},
size: [this.gridSizeX, this.gridSizeY],
ticks: [10, 1]
},
{
visuals: {
Expand Down

0 comments on commit 0d0b2d8

Please sign in to comment.