-
Notifications
You must be signed in to change notification settings - Fork 947
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
Add support for DrawText maxSize parameter to all platforms #1559
Comments
I have also been thinking about this with respect to #1556, where a common method to perform text arranging could handle computing/intersecting clipping rects also (currently it throws if given a non-null The WPF behaviour seems to be to equivalent to clamping the bounds of the whole block of text before arranging it, and then effectively rendering the text in the top-left corner. I'll try messing around with this later on today. |
Irritating, I think the clipping has to be done on the text itself, because clipping rects are non-rotational. |
The more I think about this the more I realize that this is a feature that brings a lot of complications when we want to support it properly. Especially when it is combined with multi-line text and rotation. I am wondering if this is really worth the trouble? After all, I think pretty much the only place where this is actually used is to clip axis titles and (since recently) plot titles. Is there an easier way we could achieve this? Just a thought: Could we remove the |
I guess it depends on what we want. From my perspective, the current WPF behaviour is undesirable, because clipping by pixel produces partial glyphs that could be misleading, and can otherwise fail to convey that anything has been trimmed. I'd prefer something equivalent to WPF's CharacterEllipsis. This is what people are used to from e.g. Windows Explorer. This would be easy to add to #1556 for example, and it would be easy to switch WPF and GDI+ to use these methods as they are built in. You mentioned not encountering it in usage, and I'll second that experience: if anything were ever clipping then I would make the plot bigger to accommodate, but I usually have the freedom to make them any size I want where others might not. Maybe we should try to solicit input from people who do rely on it (e.g. @UndisputedBasement33). I'm certainly happy to go to the trouble of implementing all of this if we can put it all in one place. |
I would also prefer the CharacterEllipsis rather than just clipping by pixel. In my (windows wpf)-App I have a Tab with in total 6 PlotViews. Each plot has a title, that fits nicely, if the app is started. But since the user has the possibility to change the window size the plots scale accordingly. I want to have this behavior because even the smaller plots deliver the information that is necessary. But at some point the size is that small that the title doesn't fit anymore, and then the titles of the plots next to each other start to overlay: (the pictures are from the released Oxyplot version, without clipping functionality) As you can see the title overlays even space that is not assigned for the plotview (means it goes out of the border of the groupbox and overlays even the border of the whole app) |
@UndisputedBasement33 thanks for commenting: I'll be sure to add |
As became apparent in #1558, not all
IRenderContext
implementations support themaxSize
parameter ofDrawText(...)
.I think we could address this by:
maxSize
parameter fromIRenderContext.DrawText()
RenderingExtensions.DrawText()
extension method with themaxSize
parameterThat way I think it should be possible to get this to work on all platforms that natively support clipping.
I might have a look at this later.
The text was updated successfully, but these errors were encountered: