Add setShapeFlag and getLastSnappedPoint.