title: Android canvas: text is under the shape
body: <p>I want to draw Text on Triangle I do this: </p>
  
  <pre><code>for(Widgets widget: wid) {
          if(widget.getTypeString().contains("Triangle")) {
              LOGGER.info(widget.getName());
              paintTriangle.setAntiAlias(true);
  
              seuils = JSONUtils.getSeuilAndColor(widget);
              value = JSONUtils.getValue(widget);
  
              int color = this.getColorSeuil();
  
              paintTriangle.setColor(color);
              paintTriangle.setStrokeWidth(2);
              paintTriangle.setStyle(Paint.Style.FILL);
  
              if(canvas.getWidth() &lt; c.x){
                  a.set(150, a.y + 300);
                  b.set(10, b.y + 300);
                  c.set(310, c.y + 300);
                  path.moveTo(a.x, a.y);
              }
              path.lineTo(a.x, a.y);
              path.lineTo(b.x, b.y);
              path.lineTo(c.x, c.y);
              canvas.drawPath(path, paintTriangle);
              canvas.drawText(widget.getName(), b.x+20, b.y-20, paintText);
  
              a.set(a.x + 310, a.y);
              b.set(b.x + 310, b.y);
              c.set(c.x + 310, c.y);
              path.moveTo(a.x, a.y);
          }
      }
  </code></pre>
  
  <p>The widget contains some information to build this Triangle:</p>
  
  <ul>
  <li>When the widget contains "Triangle" in the name it draws the Triangle</li>
  <li>The variable "seuils" is a HashMap that contains an Integer of a threshold and its color, that means when the variable "value" is over the treshold, the variable "color" changes and in that way the color of the shape changes too.</li>
  </ul>
  
  <p>So my problem is if I have more than one Triangle, the Text is under the first shapes but over the last.</p>
  
  <p><a href="http://i.stack.imgur.com/QoKpX.png" rel="nofollow">Text under shapes</a></p>
  
  <p>I don't understand because it works with methods Rect and Circle, and I do it in the same way.</p>