Code example for Path

Methods: computeBounds

0
public class GliphDel extends Gliph { 
    private static final float WEIGHT_NORMAL = 5f;
    private static final float WEIGHT_BOLD   = 10f;
 
    @Override 
    protected final void initialize(Path path, boolean bold) {
        float h=60f, w=120f;
        float b = bold ? WEIGHT_BOLD : WEIGHT_NORMAL;
        float b2 = b*(float)Math.sqrt(2f),
              b3 = b2/2;
 
        path.moveTo(w, h);
 
        path.lineTo(   w,   0f);
        path.lineTo( h/2,   0f);
        path.lineTo(  0f,  h/2);
        path.lineTo( h/2,    h);
        path.lineTo(   w,    h);
 
        path.close();