# Any trick to inverse fill from Path?

**URL:** <https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542>\
**Category:** General JUCE discussion\
**Created:** [February 3, 2016, 5:29am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542 "2016-02-03T05:29:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [February 3, 2016, 5:29am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542/1 "2016-02-03T05:29:13Z")

</div>

I am currently using the Path class to implement (alpha blended) selections on a GUI and it works OK otherwise but I can't figure out any nice way to make an inverse fill out of the path. (To allow for inverting the user selection.)

 ![](http://i.imgur.com/tnrv8uS.jpg)

Maybe Path is the wrong class to use for this to begin with? But it sure is pretty convenient to allow for "lasso" style selections, for example.

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [February 3, 2016, 8:32am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542/2 "2016-02-03T08:32:10Z")

</div>

Not sure I understand - do you want your lassoed area to effectively cut out of the full rectangle? If so, then draw the rectangle, change the winding rule with&nbsp;setUsingNonZeroWinding() and then add the lasso path.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [February 3, 2016, 10:23am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542/3 "2016-02-03T10:23:32Z")

</div>

Starting from a state like shown in the screenshot, I would like to switch the filled in area to be outside the freeform selection, leaving the lassoed area in its original state.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 3, 2016, 10:42am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542/4 "2016-02-03T10:42:42Z")

</div>

Yes, Andrew's suggestion is what you need to do then.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [February 3, 2016, 11:01am UTC](https://forum.juce.com/t/any-trick-to-inverse-fill-from-path/16542/5 "2016-02-03T11:01:21Z")

</div>

OK, I was able to implement this by adding a rectangle into the Path and setting the winding rule as needed.
