Skip to content

Commit

Permalink
Improve code style and spacings
Browse files Browse the repository at this point in the history
  • Loading branch information
abc013 committed Feb 17, 2024
1 parent 50fa607 commit df58339
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion playground/BaseNodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class BaseNodeEditor extends Node {
.setObjectCallback( getObjectCallback )
.setSerializable( false );

setOutputAestheticsFromNode(title, value);
setOutputAestheticsFromNode( title, value );

const contextButton = new ButtonInput().onClick( () => {

Expand Down
28 changes: 14 additions & 14 deletions playground/DataTypeLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const typeToLengthLib = {
Vector3: 3,
Vector4: 4,
Color: 4,
// cpu: other stuff
// cpu: other stuff
Material: 1,
Object3D: 1,
CodeNode: 1,
Expand Down Expand Up @@ -62,7 +62,7 @@ export const typeToColorLib = {
Vector3: '#0000ff',
Vector4: '#0000ff',
Color: '#00ffff',
// cpu: other stuff
// cpu: other stuff
Material: '#228b22',
Object3D: '#00a1ff',
CodeNode: '#ff00ff',
Expand All @@ -83,17 +83,17 @@ export function getColorFromNode( value ) {

let type = getTypeFromNode( value );

return getColorFromType(type);
return getColorFromType( type );

}

export function getTypeFromNode ( value ) {

if (value) {
if ( value ) {

if (value.isMaterial) return 'Material';
if ( value.isMaterial ) return 'Material';

return value.nodeType === 'ArrayBuffer' ? 'URL' : (value.nodeType || getTypeFromValue(value.value));
return value.nodeType === 'ArrayBuffer' ? 'URL' : ( value.nodeType || getTypeFromValue( value.value ) );
}

}
Expand Down Expand Up @@ -124,35 +124,35 @@ export function getColorFromValue( value ) {

export function setInputAestheticsFromType( element, type ) {

element.setInput( getLengthFromType(type) );
element.setInputColor( getColorFromType(type) );
element.setInput( getLengthFromType( type ) );
element.setInputColor( getColorFromType( type ) );

return element;

}

export function setOutputAestheticsFromNode( element, node ) {

if (!node) {
if ( ! node ) {

element.setOutput(0);
element.setOutput( 0 );

return element;

}

let type = getTypeFromNode( node );

if (!type) {
if ( ! type ) {

element.setOutput(1);
element.setOutput( 1 );

return element;

}

element.setOutput( getLengthFromType(type) );
element.setOutputColor( getColorFromType(type) );
element.setOutput( getLengthFromType( type ) );
element.setOutputColor( getColorFromType( type ) );

return element;

Expand Down
2 changes: 1 addition & 1 deletion playground/editors/ScriptableEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ScriptableEditor extends BaseNodeEditor {

getColor() {

return ( getColorFromType( this.layout ? this.layout.outputType : null ) ) + 'BB';
return getColorFromType( this.layout ? this.layout.outputType : null ) + 'BB';

}

Expand Down

0 comments on commit df58339

Please sign in to comment.