From c855390498927053fb5a4913deccf12b2fb59fc7 Mon Sep 17 00:00:00 2001 From: Xavier Schott Date: Sat, 15 Apr 2017 22:42:17 -0700 Subject: [PATCH] Normalize tgpValueChanged to a UInt while allowing negative slider offsets. Fixes #25 --- TGPControls/TGPDiscreteSlider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TGPControls/TGPDiscreteSlider.swift b/TGPControls/TGPDiscreteSlider.swift index fbfcddc..71b987b 100644 --- a/TGPControls/TGPDiscreteSlider.swift +++ b/TGPControls/TGPDiscreteSlider.swift @@ -279,7 +279,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER { func sendActionsForControlEvents() { // Automatic UIControlEventValueChanged notification if let ticksListener = ticksListener { - ticksListener.tgpValueChanged(value: UInt(value)) + ticksListener.tgpValueChanged(value: UInt(value-minimumValue)) } }