Browse Source

add base apply template method

pull/4051/head
Jumar Macato 6 years ago
parent
commit
7abe7cc926
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 4
      src/Avalonia.Controls/Slider.cs

4
src/Avalonia.Controls/Slider.cs

@ -134,6 +134,8 @@ namespace Avalonia.Controls
/// <inheritdoc/>
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_decreaseButtonPressDispose?.Dispose();
_decreaseButtonReleaseDispose?.Dispose();
_increaseButtonSubscription?.Dispose();
@ -189,7 +191,7 @@ namespace Avalonia.Controls
private void MoveToPoint(PointerPoint x)
{
var orient = Orientation == Orientation.Horizontal;
var pointDen = orient ? _track.Bounds.Width : _track.Bounds.Height;
pointDen += double.Epsilon; // Just add epsilon to avoid divide by zero exceptions.

Loading…
Cancel
Save