     color.setStroke()
     bezier6Path.lineWidth = 2.5 * lineWidthScalingFactor
     bezier6Path.stroke()
-}
+    
+    CGContextRestoreGState(ctx)
+}

// SHAPE FUNCTIONS //
/////////////////////

func drawBackspace(bounds: CGRect, color: UIColor) {
    let highestX = CGFloat(43.5)
    let highestY = CGFloat(31.5)
    let xScalingFactor = (CGFloat(1.0) / highestX) * bounds.width
    let yScalingFactor = (CGFloat(1.0) / highestY) * bounds.height
    let lineWidthScalingFactor = bounds.width / highestX
    
    //// PaintCode Trial Version
    //// www.paintcodeapp.com

        color2.setFill()
        rectanglePath.fill()
    }
    
    CGContextRestoreGState(ctx)
}

func drawGlobe(bounds: CGRect, color: UIColor) {
    let factors = getFactors(CGSizeMake(41, 40), bounds.size)
    let xScalingFactor = factors.xScalingFactor
    let yScalingFactor = factors.yScalingFactor
    let lineWidthScalingFactor = factors.lineWidthScalingFactor
    
    let ctx = UIGraphicsGetCurrentContext()
    CGContextSaveGState(ctx)
    CGContextTranslateCTM(ctx, (factors.fillIsHorizontal ? 0 : factors.offset), (factors.fillIsHorizontal ? factors.offset : 0))
    
    //// PaintCode Trial Version
    //// www.paintcodeapp.com
