Adapted to support rectangular and elliptic borders