Merge "Add bounds checking to nine patch scaling" into lmp-dev