# Bug with Slider::setRotaryParameters

**URL:** <https://forum.juce.com/t/bug-with-slider-setrotaryparameters/10504>\
**Category:** General JUCE discussion\
**Created:** [May 28, 2013, 12:55pm UTC](https://forum.juce.com/t/bug-with-slider-setrotaryparameters/10504 "2013-05-28T12:55:16Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [April 2, 2019, 10:48am UTC](https://forum.juce.com/t/bug-with-slider-setrotaryparameters/10504/6 "2019-04-02T10:48:05Z")

</div>

I would like to emulate a hardware synth where you can turn a dial forever to manipulate a value. And I expected stopAtEnd to work for linear control.

At the end of ‘handleAbsoluteDrag’

```auto
		if (rotaryParams.stopAtEnd)
		{
			valueWhenLastDragged = owner.proportionOfLengthToValue (jlimit (0.0, 1.0, newPos));
		}else
		{
			valueWhenLastDragged = owner.proportionOfLengthToValue (newPos - floor(newPos));
		}

```

And in ‘getMouseWheelDelta’

```auto
   	    auto newPos = currentPos + proportionDelta;
		if (rotaryParams.stopAtEnd)
			return owner.proportionOfLengthToValue(jlimit(0.0, 1.0, newPos)) - value;
		else
			return owner.proportionOfLengthToValue(newPos - floor(newPos)) - value;

```

And any other I haven’t thought of. 🙂

---

_[View the full topic](https://forum.juce.com/t/bug-with-slider-setrotaryparameters/10504)._
