# Slider keeps getting redrawn

**URL:** <https://forum.juce.com/t/slider-keeps-getting-redrawn/21244>\
**Category:** General JUCE discussion\
**Created:** [March 7, 2017, 3:54pm UTC](https://forum.juce.com/t/slider-keeps-getting-redrawn/21244 "2017-03-07T15:54:29Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![gordcragg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/gordcragg/32/519_2.png) [@gordcragg](https://forum.juce.com/u/gordcragg)\
**Post date:** [March 8, 2017, 6:10am UTC](https://forum.juce.com/t/slider-keeps-getting-redrawn/21244/4 "2017-03-08T06:10:36Z")

</div>

I encountered a very similar issue last year, and nothing I have attempted so far has fixed it.

Apparently it is a shortcoming of CoreGraphics, as Jules explains in this thread:

> [@Again: unnecessary Calls to paint() MacOSX](https://forum.juce.com/t/again-unnecessary-calls-to-paint-macosx/16716):
>
> Here is a simple Demo-Component. It owns two opaque components.&nbsp;If you repaint() both of them at the same time, the parent-component paint() method will&nbsp;be called too (but it will not redraw, confirmed with random colour-fill). &nbsp;So if there is nothing repainted, why&nbsp;is it called? Maybe room for huge performance improvment? &nbsp; class MainContentComponent : public Component, public Timer { public: MainContentComponent() { addAndMakeVisible(c1); addAndMakeVis…

I assume this is the problem you are encountering. I tried using the `JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS` macro but it didn’t reduce the number of unnecessary repaints - perhaps I am doing something wrong or misunderstanding.

This is a huge issue for me, as I have many sliders placed between meters in my plugin UI. They repaint so frequently that it spikes my CPU usage in macOSX. I have even considered a major UI redesign simply due to this issue, but it would be an unfortunate compromise. Everything works as it should on Windows.

---

_[View the full topic](https://forum.juce.com/t/slider-keeps-getting-redrawn/21244)._
