~pierrec

Recent activity

Re: [PATCH gio] op/clip: automatically close Path in Outline a month ago

From Pierre Curto to ~eliasnaur/gio-patches

> >  // Op returns a clip operation representing the outline.
> > +// The path is automatically closed if that is not already the case.
> >  func (o Outline) Op() Op {
> >       if o.Path.open {
> > -             panic("not all path contours are closed")
> > +             // Closing the path as it is a requirement for an Outline.
> > +             // This fixes cases where relative methods were used on Path
> > +             // which produce rounding errors and have a Path not exactly
> > +             // closed whereas it should have been.
> > +             o.Path.from.Close()
>
> I don't think this is enough. Consider a path that looks like "CC",
> with two gaps; Path.Close only closes the last gap.
>

Re: [PATCH gio] gpu/headless: add ScreenshotInto method to Window a month ago

From Pierre Curto to ~eliasnaur/gio-patches

Oups I didnt mean to include ScreenshotRegion. But I will merge all of
them into:

// Screenshot transfers the Window content at origin to img.
func Screenshot(origin image.Point, img *image.RGBA) error

Le mer. 15 déc. 2021 à 10:01, Elias Naur <mail@eliasnaur.com> a écrit :
>
> On Wed Dec 15, 2021 at 08:59 CET, ~pierrec wrote:
> > From: Pierre Curto <pierre.curto@gmail.com>
> >
> > When extracting headless.Window's content via screenshots,
> > it can be useful to keep reusing the same image for output,
> > as well as specify which area of the Window is to be

Re: [PATCH gio] op/clip: automatically close Path in Outline a month ago

From Pierre Curto to ~eliasnaur/gio-patches

> I don't think this is enough. Consider a path that looks like "CC",
> with two gaps; Path.Close only closes the last gap.
>
> Your patch got me thinking, though. The problem is that we'd like to
> patch up gaps without having to process all path elements to find them
> (after all, most outlines contain no gaps).
> What if we recorded special path elements for each gap, with an index to
> the next gap? That way we could efficiently skip gap-less path elements
> and only process the gaps (for outlines), or ignore them (for strokes).
>
> In other words, for each gap, record a scene.Gap which is similar to
> scene.Line except it contains an index to the next scene.Gap (if any).
> Then, the renderers convert scene.Gap to scene.LineTo for outlines, or
> ignore them for strokes.

Re: Request for comments for a op.Save/Load replacement a month ago

From Pierre Curto to ~eliasnaur/gio

You can do this instead of the old Save/Load:

defer op.Offset(f32.Point{}).Push(gtx.Ops).Pop()

This will save all operations and resume where it was upon function exit.

Le jeu. 9 déc. 2021 à 15:55, Jeff Williams <kanobe@gmail.com> a écrit :
>
> > Good idea. I've pushed the API change with a op.Save/Load that works for
> > the transformation and clip stack. I didn't figure out a nice way to
> > preserve the pointer.AreaOp stack.
>
> Are the op.Save and op.Load functions still available? I can't seem to
> find them in v0.0.0-20211207114553-03016f0c69b7.

Re: [PATCH gio] widget: add drag and drop support a month ago

From Pierre Curto to ~eliasnaur/gio-patches

> > +// CancelEvent is sent to data sources and targets to cancel the
> > +// effects of an InitiateEvent.
> > +type CancelEvent struct{}
> > +
> > +func (CancelEvent) ImplementsEvent() {}
> > +
> > +// DataEvent is sent to the target receiving the transfer.
> > +type DataEvent struct {
> > +     // Type is the MIME type of Data.
> > +     Type string
> > +     // Data contains the offered data. It is only valid during the
> > +     // frame that contained the DataEvent.
> > +     Data io.Reader
>

Re: [PATCH gio] op/clip: fix unclosed Path even with Path.Close a month ago

From Pierre Curto to ~eliasnaur/gio-patches

Le jeu. 2 déc. 2021 à 10:49, Elias Naur <mail@eliasnaur.com> a écrit :
>
> On Sun Nov 28, 2021 at 19:09 CET, ~pierrec wrote:
> > From: Pierre Curto <pierre.curto@gmail.com>
> >
> > Depending on how a path is built, it may not close
> > even with an explicit call to its Close method.
> >
>
> Indeed, Close only works if there were no previous gaps.
>
> I don't understand the purpose of this patch. You suppress
> the panic, but leave the path with gaps?

Re: Close a window on Wayland a month ago

From Pierre Curto to ~eliasnaur/gio

Hello,

Thanks for the feedback!
I have pushed a patch[1] to address this particular issue. Now that I
have gotten my Wayland back to work, I can actually do some testing.
Also looking at the other missing implementations, but this is much
harder.

Pierre

[1] https://lists.sr.ht/~eliasnaur/gio-patches/patches/26817

Le mer. 24 nov. 2021 à 07:56, Ming-Ming Yao
<ming-ming_yao@keysight.com> a écrit :

Re: [PATCH gio] widget: add drag and drop support 2 months ago

From Pierre Curto to ~eliasnaur/gio-patches

Le sam. 13 nov. 2021 à 14:46, Elias Naur <mail@eliasnaur.com> a écrit :
>
> On Thu Nov 11, 2021 at 14:34, ~pierrec wrote:
> > From: Pierre Curto <pierre.curto@gmail.com>
> >
> > This patch implements DnD support for API validation.
> > Experimental and not to be merged.
> >
> > An example of its use is located at https://git.sr.ht/~pierrec/dnd-example.
> >
>
> Thank you, I think we're getting close.
>
> I haven't looked too closely at the router machinery; I'd rather wait

Re: Conversion between Dp and Px, and float type 2 months ago

From Pierre Curto to ~eliasnaur/gio

>
> Perhaps we start by keeping unit.Value, but make it a type parameter constraint type:
>
> package unit
>
> type Value interface {
>         Dp | Sp
> }
>
> We could then keep gtx.Px (and Pxf) as is, and we'd be backwards
> compatible with old Gio code (I think).
>
> Then, we can convert widgets to use specific types (unit.Sp, unit.Dp) if
> we'd like to shorten their typical use, without breaking compatibility.

Re: [PATCH gio] gesture: add Position method 2 months ago

From Pierre Curto to ~eliasnaur/gio-patches

Le sam. 13 nov. 2021 à 10:57, Elias Naur <mail@eliasnaur.com> a écrit :
>
> On Fri Nov 12, 2021 at 18:13, ~pierrec wrote:
> > From: Pierre Curto <pierre.curto@gmail.com>
> >
> > The Position method tracks the pointer position when hovered.
> >
> > Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
> > ---
> >  gesture/gesture.go      | 14 +++++++++++++-
> >  gesture/gesture_test.go |  3 +++
> >  2 files changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/gesture/gesture.go b/gesture/gesture.go