     color2.setStroke()
     bezier3Path.lineWidth = 2.5 * lineWidthScalingFactor
     bezier3Path.stroke()
+    
+    CGContextRestoreGState(ctx)
 }
 
 func drawShift(bounds: CGRect, color: UIColor, withRect: Bool) {
-    let highestX = CGFloat(37)
-    let highestY = CGFloat((withRect ? 34.5 + 4 : 31.5))
-    let xScalingFactor = (CGFloat(1.0) / highestX) * bounds.width
-    let yScalingFactor = (CGFloat(1.0) / highestY) * bounds.height
+    let factors = getFactors(CGSizeMake(37, (withRect ? 34.5 + 4 : 31.5)), 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

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

func drawGlobe(bounds: CGRect, color: UIColor) {
    let highestX = CGFloat(41)
    let highestY = CGFloat(40)
    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

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