 	}
 
 	private dynamic func onTogglePanning(tgr:UITapGestureRecognizer) {
-		panning = !panning
+
+		// no animation happens because self.panning performs layout by calling setNeedsLayout
+		UIView.animateWithDuration(0.2) {
+			self.panning = !self.panning
+		}
 	}
 }
 

	private var panning:Bool = false {
		didSet {
			currentPanTranslation = CGPoint(x: bounds.width/2 - drawingSize.width/2, y: bounds.height/2 - drawingSize.height/2)
			setNeedsLayout()
		}
	}


		}
	}

	private func updatePan() {
		if let drawingView = drawingView {
			let size = drawingView.controller!.viewport.size
