|
|
> IMHO there is so little use of clipping to anything other than a rectangle that there is no need to support it.
While it might be a slightly more niche drawing feature, I think it's general usefulness is demonstrated by the large number of drawing apis that support such a feature. CSS allows for an "overflow: hidden" attribute, which clips to the bounds of the element. Qt has a setClipPath() and setClipRegion() method.
However, it doesn't look like GTK or imgui support clipping to a path/non rectangular region.
I also found this, which seems to explain some of the difficulties of clipping to a shape: On Tuesday, July 27, 2021 at 1:26:55 PM UTC-4 spitzak wrote:
Any region clipping probably should be part of the drawing api. Fl_Region is just left over from an attempt to provide some access to X clipping, and exposes how it works far too much. IMHO there is so little use of clipping to anything other than a rectangle that there is no need to support it. Rectangles are relatively easy, as intersecting two of them is still a rectangle.
Perhaps if no examples of using a Fl_Region exist and people are not using Fl_Region/don't know how to use FL_Region, it should be deprecated or removed?
Additionality, requiring OS-specific code to generate an FL_Region seems to clash with FLTK's cross-platform nature.
That being said, I think having a means of providing an arbitrary clipping shape in FLTK's drawing module is still highly desirable.
I know that we can set an arbitrary shape for a Window, would it be impossible to translate this design into a method that would work in the context of the draw module?
On Tuesday, July 20, 2021 at 1:15:51 PM UTC-4 Webb Hinton wrote:
Yes I'm a little confused about the "Region" API. Does anyone have an example of how to use this?
On Tuesday, July 20, 2021 at 6:05:30 AM UTC-4 Manolo wrote:
FLTK provides only ways to clip to a rectangle. It's also possible to clip to a region, but FLTK contains no means to create a region. The region is expected to have been created for FLTK by the OS.
Fl_Window::shape() method controls the shape of the window itself, thus it prevents any drawing outside the shape region.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/746c3c94-67bb-4068-b802-163ce636fef4n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |