<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Slider middle position formula]]></title><description><![CDATA[<p dir="auto">I have created a slider with a panel, the slider goes from -100 to +6 I would like the middle position of the slider to be -18, anyone know the formula I need?</p>
<p dir="auto">Here's my paint routine for drawing the vertical slider. I have the middle value stored as <code>this.data.middleValue</code>.</p>
<pre><code>var range = this.get("max") - this.get("min"); //-100 to +6
var newVal = (this.get("height") / range) * (-this.get("min") + this.getValue());
    
g.fillAll(this.get("bgColour"));
g.setColour(this.get("itemColour"));
       
g.fillRect([0, this.get("height")-newVal, this.get("width"), this.get("height")]);
</code></pre>
]]></description><link>https://forum.hise.audio/topic/849/slider-middle-position-formula</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 01:35:22 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/849.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Aug 2018 16:55:28 GMT</pubDate><ttl>60</ttl></channel></rss>