PreventPaging vs ScaleToFit elements #92
Replies: 5 comments
-
+1 for |
Beta Was this translation helpful? Give feedback.
-
+1 for ScaleToFit from me as well. But I can imagine cases when the scaling makes the text too small. (I know of designers who complain about every subpixel deviation). If it is not too hard to implement, maybe a threshold could help to limit the scaling. If it is surpassed, then you could do the paging or clip the content. Something like .ScaleToFit(2.0f) to stay in a 2% range |
Beta Was this translation helpful? Give feedback.
-
I agree that scaling text would be problematic for the reasons you mention - but scaling other content is very helpful. In the same way, truncating text is also very helpful in my opinion - especially for variable length text rendered in any font that is not fixed-width. |
Beta Was this translation helpful? Give feedback.
-
+1 for a |
Beta Was this translation helpful? Give feedback.
-
I know it's not particularly helpful, but I can think of situations where both would be useful. If |
Beta Was this translation helpful? Give feedback.
-
Recently, I was thinking about the following use-case: we have a constrained box (e.g. with maximum width/height) and content (most likely text) inside. We expect that sometimes the text may not fit inside the box and therefore trigger the paging behaviour.
Right now, I see two solutions:
Create a
PreventPaging
/Truncate
element - when its child wants to wrap to the next page, it is ignored. Only the content, that fit on the origin page, will be displayed. Everything else would be skipped. For instance, this corresponds to displaying only part of the specified text.Create a
ScaleToFit
element - when it detects that a child does fit into the provided space, it attempts to scale down the child up to the point when the child fits. For instance, this corresponds to using smaller font size, so the entire text is visible. The process of finding the perfect scale (e.g. font size) can be automated with binary search.I think that the second solution (
ScaleToFit
element) is far superior to the first solution (PreventPaging
element). Do you see any important use cases when the first solution may be a better choice?@marcianobandeira @qcz @lmingle @jcl-aadlab @donmurta @adaxer @pha3z I am allowing myself to mention you, hoping you will find some time to discuss those features 😁
Beta Was this translation helpful? Give feedback.
All reactions