         }
     }
     
+    // dummy. テストのために追加.
+    var topEdge = CGFloat(0)
+    
     var currentPageIndex = 0 {
         didSet {
             CATransaction.begin()

    }
    
    func setLayerFrames() {
        self.topPage.frame = CGRect(x: self.layer.bounds.origin.x, y: self.layer.bounds.origin.y, width: self.leafEdge * self.bounds.size.width, height: self.layer.bounds.size.height)
        
        self.topPageReverse.frame = CGRect(x: self.layer.bounds.origin.x + (2 * self.leafEdge - 1) * self.bounds.size.width
            , y: self.layer.bounds.origin.y, width: (1 - self.leafEdge) * self.bounds.size.width, height: self.layer.bounds.size.height)
        
        self.bottomPage.frame = self.layer.bounds
        self.topPageShadow.frame = CGRect(x: self.topPageReverse.frame.origin.x - 40, y: 0, width: 40, height: self.bottomPage.bounds.size.height)
        
        self.topPageReverseImage.frame = self.topPageReverse.bounds
        self.topPageReverseImage.transform = CATransform3DMakeScale(-1, 1, 1)
        self.topPageReverseOverlay.frame = self.topPageReverse.bounds
        self.topPageReverseShading.frame = CGRect(x: self.topPageReverse.bounds.size.width - 50, y: 0, width: 50 + 1, height: self.topPageReverse.bounds.size.height)
        
        self.bottomPageShadow.frame = CGRect(x: self.leafEdge * self.bounds.size.width, y: 0, width: 40, height: self.bottomPage.bounds.size.height)
        self.topPageOverlay.frame = self.topPage.bounds
    }
    
    func willTurnToPageAtIndex(index: Int) {
        self.delegate.leavesView(leavesView: self, willTurnToPageAtIndex: index)

        CATransaction.begin()
        CATransaction.setValue(NSNumber(value: 0.07), forKey: kCATransactionAnimationDuration)
        self.leafEdge = touchPoint.x / self.bounds.size.width
        
        // dummy.
        self.topEdge = touchPoint.y / self.bounds.size.height
        
        CATransaction.commit()
    }
    
