A simple sequence of \draw commands can also be reverted by TeX. In the following example, macro \reversedraws goes before the sequence of \draw commands, which should be reverted. It stores them in macro \collect@draws in reverse order. After the last \draw, the now reverted list is output:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}

\usepackage{etoolbox}% provides \preto
\makeatletter
\newcommand*{\collect@draws}{}
\newcommand*{\reversedraws}{%
  \renewcommand*{\collect@draws}{}% initialize
  \look@for@draw
}
\newcommand*{\look@for@draw}{%
  \@ifnextchar\draw{%
    \catch@draw
  }{%
    \collect@draws % output the result
  }%
}
\def\catch@draw\draw#1;{%
  \preto\collect@draws{\draw#1;}%
  \look@for@draw
}
\makeatother

\begin{document}
  \begin{tikzpicture}
    \reversedraws
    \draw [fill=blue,ultra thick] (0.4,0.5) rectangle (0,1);
    \draw [fill=red,ultra thick] (0,0.3) rectangle (1,1);
    \draw [fill=green,ultra thick] (0,0) rectangle (0.5,0.5);
  \end{tikzpicture}
\end{document}



  


Of course fixing the C++ tool program to output the correct order is the better approach and can be done more efficient in linear time there. In the example above, the run time behavior is quadratic.

Tikz: how to change the order of overlapping objects?
I have a MacBook Pro Retina 2.5 GHz Core i7 with OS X 10.9.5 from March 2014.

I teach in an Adobe classroom every week, and have never had the following problem until last night after I downloaded the new Adobe Plug-in.

The video pod in the room has always recognized the camera on one of my two Thunderbolt displays as the video source (and optional audio feed) for my classroom. As of last night however, after the update downloaded in Firefox the Thunderbolt camera and audio are no longer recognized, only FaceTime HD is listed. I can get a video feed only when I open up the laptop.

The audio option from my displays is also gone from the list in Adobe. In Google Chrome, the Adobe room video dropdown option box essentially says, "No camera available" - so in Chrome it does not even recognize the MacBook Pro's camera as available. I usually use Firefox, and have never had problems until last night's update.

Bottom line, my MacBook Pro no longer seems to recognize that the Thunderbolt displays have a camera and audio feed available. Can someone help me to fix this please?
