The problem with your second patch is that setting attributes during reflow (or changing styles in other ways) is strictly forbidden. You could get away with it in a post-reflow callback but it's still a heavyweight solution. Modifying InitOffsets sounds like it could work.
The problem with your second patch is that setting attributes during reflow (or changing styles in other ways) is strictly forbidden. You could get away with it in a post-reflow callback but it's still a heavyweight solution. Modifying InitOffsets sounds like it could work.