@Override
    protected void onDraw(Shape shape, Canvas canvas, Paint paint) {

      canvas.save();
      canvas.translate(widthFactor / 2, heightFactor / 2);

      shape.draw(canvas, paint);

      canvas.restore();
    }
Ejemplo n.º 2
0
 @Override
 protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
   shape.draw(canvas, fillpaint);
   shape.draw(canvas, strokepaint);
 }
Ejemplo n.º 3
0
 public void setHeight(float height) {
   Shape s = shape.getShape();
   s.resize(s.getWidth(), height);
 }
Ejemplo n.º 4
0
 public void setWidth(float width) {
   Shape s = shape.getShape();
   s.resize(width, s.getHeight());
 }
Ejemplo n.º 5
0
 /**
  * Called from the drawable's draw() method after the canvas has been set to draw the shape at
  * (0,0). Subclasses can override for special effects such as multiple layers, stroking, etc.
  */
 protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
   shape.draw(canvas, paint);
 }