Pre-caching a value cast to integer to speed up the pencil paint operation