Skip to content

Commit 6f9d4d6

Browse files
committed
With StayOnCenter Ripple try to wrap only content of button
1 parent 5f5c2aa commit 6f9d4d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MaterialDesignThemes.Wpf/Ripple.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventA
4141

4242
double width, height;
4343

44-
if (innerContent != null)
44+
if (StayOnCenter && innerContent != null)
4545
{
4646
width = innerContent.ActualWidth;
4747
height = innerContent.ActualHeight;
@@ -87,7 +87,8 @@ protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
8787
{
8888
Point position = innerContent.TransformToAncestor(this)
8989
.Transform(new Point(0, 0));
90-
RippleX = position.X + innerContent.ActualWidth/ 2 - RippleSize / 2;
90+
91+
RippleX = position.X + innerContent.ActualWidth / 2 - RippleSize / 2;
9192
RippleY = position.Y + innerContent.ActualHeight / 2 - RippleSize / 2;
9293
}
9394
else

0 commit comments

Comments
 (0)