-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Positions referencing text runs may lead to confusion #26
Comments
I had ulterior motives for this relationship; that is to be unambiguous about the character data's container. In our case that's a |
I believe so. And to be more explicit - an immutable copy of the text container which was used for the formatting referenced by this paragraph. In case the concern is increased memory usage / GC risk then potentially copy-on-write techniques can be applied by implementers to mitigate. |
Ah. So very similar to issue #23 |
Open question on this issue is whether the metrics will provide an immutable reference to the input text, or whether the Position will need to have a looser coupling with the input than previously described (array-indexes vs object references) which may exacerbate the concerns leading to this issue in the first place. |
FormattedTextPosition
- thesource
reference aFormattedTextRun
which is a mutable object (or does it reference a read only copy?). This means it might point to a run which is not the run used to format the paragraph. I think it might lead to confusion and potential bugs. Is it possible to consider a design which follows immutability principle? I assume the reason it is done like that is to reduce potential GC load but is it really such a concern compared to the risk?@nhelfman
The text was updated successfully, but these errors were encountered: