         }
         self.eventLayers.removeAll()
 
-        var factorChange = CGFloat(1)
-        let newHeight = self.frame.height
-        if prevHeight == nil {
-            prevHeight = newHeight
-        }
-        else {
-            factorChange = newHeight / prevHeight!
-        }
+        var scaleY = CGFloat(1)
+
+        scaleY = self.frame.height/prevHeight
+        prevHeight = self.frame.height
 
         // Generate event rectangle shape layers and text layers
         for (id, frame) in self.eventFrames {

    private var seperatorLayers: [CAShapeLayer] = []
    // Event rectangle shape layers
    private var eventLayers: [CALayer] = []
    // PRevious height
    private var prevHeight: CGFloat?

    // Delegate variable
    weak var delegate: DayViewCellDelegate?

        self.backgroundColor = LayoutDefaults.defaultDayViewColor
        self.addGestureRecognizer(UILongPressGestureRecognizer(target: self, action: #selector(longPressAction)))
        self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(tapAction)))
        self.prevHeight = self.frame.height
    }

    override func layoutSubviews() {
