update to Maths

Should resolve some of the drawing issues as the button dimentions changed. There is still a small issue with the corners drawing when the border radius is 0.