added some basic ninepatch logic