Use proper method to create patterns in canvas