Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Aug 19, 2023
1 parent 95462d6 commit 55ff8e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
16 changes: 5 additions & 11 deletions build/mathcell.js
Original file line number Diff line number Diff line change
Expand Up @@ -3011,15 +3011,11 @@ function suspendAnimation() {
}
var texts = ${texts};
for ( var i = 0 ; i < texts.length ; i++ ) {
var t = texts[i];
addLabel( t.text, t.point[0], t.point[1], t.point[2], t.options.color, t.options.fontSize );
}
texts.forEach( t => addLabel( t.text, t.point[0], t.point[1], t.point[2],
t.options.color, t.options.fontSize ) );
var points = ${points};
for ( var i = 0 ; i < points.length ; i++ ) addPoint( points[i] );
points.forEach( p => addPoint( p ) );
function addPoint( p ) {
Expand Down Expand Up @@ -3057,7 +3053,6 @@ function addPoint( p ) {
}
var lines = ${lines};
var newLines = [], tempPoints = [];
for ( var i = 0 ; i < lines.length ; i++ ) {
Expand Down Expand Up @@ -3094,7 +3089,7 @@ for ( var i = 0 ; i < lines.length ; i++ ) {
newLines.forEach( l => lines.push( l ) );
newLines = [], tempPoints = [];
for ( var i = 0 ; i < lines.length ; i++ ) addLine( lines[i] );
lines.forEach( l => addLine( l ) );
function addLine( l ) {
Expand Down Expand Up @@ -3125,8 +3120,7 @@ function addLine( l ) {
}
var surfaces = ${surfaces};
for ( var i = 0 ; i < surfaces.length ; i++ ) addSurface( surfaces[i] );
surfaces.forEach( s => addSurface( s ) );
function addSurface( s ) {
Expand Down
16 changes: 5 additions & 11 deletions src/render/threejs-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,11 @@ function suspendAnimation() {
}
var texts = ${texts};
for ( var i = 0 ; i < texts.length ; i++ ) {
var t = texts[i];
addLabel( t.text, t.point[0], t.point[1], t.point[2], t.options.color, t.options.fontSize );
}
texts.forEach( t => addLabel( t.text, t.point[0], t.point[1], t.point[2],
t.options.color, t.options.fontSize ) );
var points = ${points};
for ( var i = 0 ; i < points.length ; i++ ) addPoint( points[i] );
points.forEach( p => addPoint( p ) );
function addPoint( p ) {
Expand Down Expand Up @@ -249,7 +245,6 @@ function addPoint( p ) {
}
var lines = ${lines};
var newLines = [], tempPoints = [];
for ( var i = 0 ; i < lines.length ; i++ ) {
Expand Down Expand Up @@ -286,7 +281,7 @@ for ( var i = 0 ; i < lines.length ; i++ ) {
newLines.forEach( l => lines.push( l ) );
newLines = [], tempPoints = [];
for ( var i = 0 ; i < lines.length ; i++ ) addLine( lines[i] );
lines.forEach( l => addLine( l ) );
function addLine( l ) {
Expand Down Expand Up @@ -317,8 +312,7 @@ function addLine( l ) {
}
var surfaces = ${surfaces};
for ( var i = 0 ; i < surfaces.length ; i++ ) addSurface( surfaces[i] );
surfaces.forEach( s => addSurface( s ) );
function addSurface( s ) {
Expand Down

0 comments on commit 55ff8e0

Please sign in to comment.