From 2379bdba987e524806eecd62cf439cd2bdad3db8 Mon Sep 17 00:00:00 2001
From: Andy Rickert <andrew_rickert@brown.edu>
Date: Thu, 9 Jan 2020 23:54:49 -0800
Subject: added icons

---
 src/client/views/nodes/RadialMenuItem.tsx | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/RadialMenuItem.tsx')

diff --git a/src/client/views/nodes/RadialMenuItem.tsx b/src/client/views/nodes/RadialMenuItem.tsx
index 727d1c3be..f077dd447 100644
--- a/src/client/views/nodes/RadialMenuItem.tsx
+++ b/src/client/views/nodes/RadialMenuItem.tsx
@@ -12,7 +12,7 @@ export interface OriginalMenuProps {
     description: string;
     event: (stuff?: any) => void;
     undoable?: boolean;
-    icon: IconProp; //maybe should be optional (icon?)
+    icon: IconProp;
     closeMenu?: () => void;
     min?: number;
     max?:number;
@@ -68,10 +68,8 @@ export class RadialMenuItem extends React.Component<RadialMenuProps & { selected
         if (circlemax%3===1 && circlemin===circlemax-1){
             color="#c2c2c5";
         }
-        console.log(this.props.selected,this.props.min)
 
         if (this.props.selected === this.props.min){
-            console.log(this.props.selected,this.props.min)
             color="#808080";
         
         }
@@ -86,10 +84,37 @@ export class RadialMenuItem extends React.Component<RadialMenuProps & { selected
     }
     }
 
+    calculatorx(){
+        let circlemin=0;
+        let circlemax=1
+        this.props.min? circlemin=this.props.min:null;
+        this.props.max? circlemax=this.props.max:null;
+        let avg = ((circlemin/circlemax)+((circlemin+1)/circlemax))/2;
+        let degrees = 360*avg;
+        let x= 100*Math.cos(degrees*Math.PI/180);
+        let y =-125*Math.sin(degrees*Math.PI/180);
+        return x;
+    }
+
+    calculatory(){
+        
+        let circlemin=0;
+        let circlemax=1
+        this.props.min? circlemin=this.props.min:null;
+        this.props.max? circlemax=this.props.max:null;
+        let avg = ((circlemin/circlemax)+((circlemin+1)/circlemax))/2;
+        let degrees = 360*avg;
+        let x= 125*Math.cos(degrees*Math.PI/180);
+        let y =-100*Math.sin(degrees*Math.PI/180);
+        return y;
+    }
+
+
     render() {
             return (
                 <div className={"radialMenu-item" + (this.props.selected ? " radialMenu-itemSelected" : "")} onClick={this.handleEvent}>
                     <canvas id="myCanvas" height="300" width="300"> Your browser does not support the HTML5 canvas tag.</canvas>
+                    <FontAwesomeIcon icon={this.props.icon} size="3x" style={{ position:"absolute", left:this.calculatorx()+150-19, top:this.calculatory()+150-19}} />
                 </div>
             );
     }
-- 
cgit v1.2.3-70-g09d2

