L Cabinet rotate Picks added
L Cabinet rotate Picks added

--- a/source/lib/scripts/CabinetEditor/Schematic/Cabinet/LCabinet.js
+++ b/source/lib/scripts/CabinetEditor/Schematic/Cabinet/LCabinet.js
@@ -12,6 +12,7 @@
 	 	'CabinetEditor/Schematic/Other/Measurements/ObjMeasurement',
 
 	 	'CabinetEditor/Picks/Item/Top/DragPick',
+	 	'CabinetEditor/Picks/Item/Top/RotatePick',
 
 	 	'CabinetEditor/Defines/Cardinal',
 	 	'CabinetEditor/Defines/Layer',
@@ -31,6 +32,7 @@
 		ObjMeasurement,
 
 		DragPick, 
+		RotatePick,
 
 		Cardinal,
 		Layer,
@@ -678,8 +680,49 @@
 //	Returns the pick the mouse is over for this cabinet
 	LCabinet.prototype.getPick = function(x, y){
 
+		var pick_space = 3,
+		np = new Point(x, y).rotateAboutPoint(this.angle, {x:this.x,y:this.y});
+
+		// NW Corner
+		if(np.x > this.x-(this.w/2)-pick_space
+				&& np.x < this.x-(this.w/2)+pick_space
+				&& np.y > this.y-(this.h/2)-pick_space
+				&& np.y < this.y-(this.h/2)+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.NW, this);
+		// NE Corner
+		if(np.x > this.x+(this.w/2)-pick_space
+				&& np.x < this.x+(this.w/2)+pick_space
+				&& np.y > this.y-(this.h/2)-pick_space
+				&& np.y < this.y-(this.h/2)+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.NE, this);
+		// SW Corner
+		if(np.x > this.x-(this.w/2)-pick_space
+				&& np.x < this.x-(this.w/2)+pick_space
+				&& np.y > this.y+(this.h/2)-pick_space
+				&& np.y < this.y+(this.h/2)+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.SW, this);
+		// E Corner
+		if(np.x > this.x+(this.w/2)-pick_space
+				&& np.x < this.x+(this.w/2)+pick_space
+				&& np.y > this.y+(this.h/2)-this.rl-pick_space
+				&& np.y < this.y+(this.h/2)-this.rl+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.SE, this);
+		// S Corner
+		if(np.x > this.x+(this.w/2)-this.ll-pick_space
+				&& np.x < this.x+(this.w/2)-this.ll+pick_space
+				&& np.y > this.y+(this.h/2)-pick_space
+				&& np.y < this.y+(this.h/2)+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.SE, this);
+
+		// SE Corner
+		if(np.x > this.x+(this.w/2)-this.ll-pick_space
+				&& np.x < this.x+(this.w/2)-this.ll+pick_space
+				&& np.y > this.y+(this.h/2)-this.rl-pick_space
+				&& np.y < this.y+(this.h/2)-this.rl+pick_space)
+			return new RotatePick(Math.atan2(this.y-y,this.x-x), Cardinal.NW, this);
+		
 		// Center
-		if(this.inBounds(new Point(x, y)))
+		if(this.inBounds(np))
 			return new DragPick(x, y, this);
 
 		return null;