From c435409bfdcda51c5ba164c9013a3da1e5a03ce6 Mon Sep 17 00:00:00 2001 From: Robert Messerle Date: Wed, 28 Jan 2015 11:25:46 -0800 Subject: [PATCH] fix(ripple): fixes size issue with ripple on switches --- src/core/services/ripple/ripple.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/services/ripple/ripple.js b/src/core/services/ripple/ripple.js index 32a51818fa5..043b35a1341 100644 --- a/src/core/services/ripple/ripple.js +++ b/src/core/services/ripple/ripple.js @@ -42,7 +42,8 @@ function InkRippleService($window, $timeout) { function attachCheckboxBehavior(scope, element, options) { return attach(scope, element, angular.extend({ center: true, - dimBackground: false + dimBackground: false, + fitRipple: true }, options)); } @@ -67,7 +68,8 @@ function InkRippleService($window, $timeout) { dimBackground: false, outline: false, isFAB: false, - isMenuItem: false + isMenuItem: false, + fitRipple: false }, options); var rippleSize, @@ -283,6 +285,9 @@ function InkRippleService($window, $timeout) { } else { multiplier = options.isFAB ? 1.1 : 0.8; size = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) * multiplier; + if (options.fitRipple) { + size = Math.min(height, width, size); + } } return size; }