# Need help with Vertical / horizontal slider

**URL:** <https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920>\
**Category:** General JUCE discussion\
**Created:** [November 28, 2022, 9:48pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920 "2022-11-28T21:48:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![OGLIN](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oglin/32/13900_2.png) [@OGLIN](https://forum.juce.com/u/OGLIN)\
**Post date:** [November 28, 2022, 9:48pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/1 "2022-11-28T21:48:17Z")

</div>

Hi all,  
I need help with something for my vertical / horizontal sliders.  
Currently, I have set lookandfeel and other characteristics of my sliders, and the thumbpoint starts correctly where I want it to be.  
For example, I have one horizontal slider that starts at the center, but the problem I have is that the background path fill is already filled on one half at default, but I would llike it to only filll up when I move the slider left or right from the center.  
Hope this isnt confusing, thanks in advance!

---

<div class="post-metadata">

**Author:** ![Fandusss](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@Fandusss](https://forum.juce.com/u/Fandusss)\
**Post date:** [November 28, 2022, 10:07pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/2 "2022-11-28T22:07:17Z")

</div>

You want to create a look and feel class and override the relevant draw slider method. Then assign an instance of that class to the slider as its look and feel.

---

<div class="post-metadata">

**Author:** ![OGLIN](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oglin/32/13900_2.png) [@OGLIN](https://forum.juce.com/u/OGLIN)\
**Post date:** [November 28, 2022, 10:53pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/3 "2022-11-28T22:53:31Z")

</div>

Do you know specifically what part of affects or what code I should look into for what I need

---

<div class="post-metadata">

**Author:** ![Marcusonic](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@Marcusonic](https://forum.juce.com/u/Marcusonic)\
**Post date:** [November 29, 2022, 5:56am UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/4 "2022-11-29T05:56:15Z")

</div>

This is how I did it, it’s for knobs, but it will serve as a reference

In the Lookandfeel drawRotarySlider function the arc starts at rotaryStartAngle and ends at the current angle, so I added in my override function that when it is symmetrical the arc is drawn from the mid angle between rotaryStarAngle and rotaryEndAngle

```
        if (slider.isSymmetricSkew())
            valueArc.addCentredArc(bounds.getCentreX(), bounds.getCentreY(), arcRadius, arcRadius, 0.0f, (rotaryStartAngle+rotaryEndAngle)/2, toAngle, true);
        else
            valueArc.addCentredArc(bounds.getCentreX(), bounds.getCentreY(), arcRadius, arcRadius, 0.0f, rotaryStartAngle, toAngle, true);

```

---

<div class="post-metadata">

**Author:** ![OGLIN](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oglin/32/13900_2.png) [@OGLIN](https://forum.juce.com/u/OGLIN)\
**Post date:** [November 29, 2022, 10:52pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/5 "2022-11-29T22:52:08Z")

</div>

thanks I will give this a try and let you know how it worked!

---

<div class="post-metadata">

**Author:** ![Fandusss](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@Fandusss](https://forum.juce.com/u/Fandusss)\
**Post date:** [November 29, 2022, 11:11pm UTC](https://forum.juce.com/t/need-help-with-vertical-horizontal-slider/53920/6 "2022-11-29T23:11:14Z")

</div>

In general, if you click through to the juce source code of the widget you are using, they will usually contain a struct of look and feel methods, so you can get an overview of what you can override there.
