FLTK logo

Re: [fltk.general] Re: Rounded Frames/Draw Rounded Rectangle

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Rounded Frames/Draw Rounded Rectangle Webb Hinton Jul 27, 2021  
 
> 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.


On Tue, Jul 27, 2021 at 9:47 AM Webb Hinton <caroli...@gmail.com> wrote:
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/9da638fa-4e62-43f9-bf19-9422e7f50ad1n%40googlegroups.com.

--
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.