From cdacd7b511c6cb811b0501b3623168f123606e78 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Tue, 6 Nov 2018 20:54:57 +0000 Subject: [PATCH] Update DayView.java `tempRect` is used by the background drawable, it doesn't need the circle logic which was forcing it to be square when the tile was rectangle. --- .../com/prolificinteractive/materialcalendarview/DayView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java b/library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java index 675e5f94..790f8a35 100644 --- a/library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java +++ b/library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java @@ -287,6 +287,8 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto } private void calculateBounds(int width, int height) { + tempRect.set(0, 0, width, height); + final int radius = Math.min(height, width); final int offset = Math.abs(height - width) / 2; @@ -295,10 +297,8 @@ private void calculateBounds(int width, int height) { Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP ? offset / 2 : offset; if (width >= height) { - tempRect.set(offset, 0, radius + offset, height); circleDrawableRect.set(circleOffset, 0, radius + circleOffset, height); } else { - tempRect.set(0, offset, width, radius + offset); circleDrawableRect.set(0, circleOffset, width, radius + circleOffset); } }