refactored the ninepatch library
added margin