~wrnr

Antwerp

https://alman.ax

Recent activity

Re: Fwd: Support Pinch 4 months ago

From Werner Laurensse to ~eliasnaur/gio

To clarify, you want Gio to emit a pointer.Event of type pointer.Move
and set a Magnification field.
Why would an extra type make the routing more complicated, it works
for me without modifying it.
If, a pinch is a move, then we always need to check if magnification
is zero to know it is a real move.

On Sat, Mar 6, 2021 at 3:03 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Fri Mar 5, 2021 at 15:38, Werner Laurensse wrote:
> > In case of a touch screen yes, but a trackpad has no 1 tot 1 mapping
> > to your screen(s).
> > The pointer doesn't even move when you do a two finger scroll.
> > On osx the way you can get the magnitude is by unpacking a ns event

Fwd: Support Pinch 4 months ago

From Werner Laurensse to ~eliasnaur/gio

forward my own msg

---------- Forwarded message ---------
From: Werner Laurensse <werner@alman.ax>
Date: Fri, Mar 5, 2021 at 3:36 PM
Subject: Re: Support Pinch
To: Elias Naur <mail@eliasnaur.com>


In case of a touch screen yes, but a trackpad has no 1 tot 1 mapping
to your screen(s).
The pointer doesn't even move when you do a two finger scroll.
On osx the way you can get the magnitude is by unpacking a ns event
into ns touch and for each

Support Pinch 4 months ago

From Werner Laurensse to ~eliasnaur/gio

There is another way to support the pinch gesture on trackpads without
adding any extra fields to pointer.Event by adding the key.ModCtrl to
the Modifiers field and setting Scroll X and Y to equal to
magnification.

This is also the way most browsers support this functionality in
javascript without having access to the trackpad touch events [1] [2]
and works on both OSX and Windows.

The problem with proving this functionality through a trackpad is that
it's touch events don't map directly to the screen and to calculate
the magnification there is still a need to track the position of the
fingers and the size of the trackpad [3] [4].

Re: stroke-path 8 months ago

From Werner Laurensse to ~eliasnaur/gio

Sebastien,

It's not my area of expertise either, but stroking a line is not as
simple as offsetting a line if you want a solution that works for any
line
that can have sharp angels and is composed out of bezier curves.

From digging through the literature I've thought there isn't even a
closed-form-solution for stroking a bezier curve,
which means you have to use numerical approximations to create the
offsets for the bezier points.

Even then, you can't just ignore line joins, caps and stroke types.

Re: Pinch Gesture API 9 months ago

From Werner Laurensse to ~eliasnaur/gio

Glad I could help.

It should be possible to reconstruct the gestures out of the
individual touch events.
On OSX this will probably means using NSTouch instead of NSEvent,
at least this is what I could gather from reading the docs:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html

Anyway, I'll give that a try to see if it works.

On Mon, Oct 26, 2020 at 9:15 AM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Mon Oct 26, 2020 at 9:41 AM CET, Werner Laurensse wrote:
> > A implementation for OSX is available in my gio repo:

Re: Pinch Gesture API 9 months ago

From Werner Laurensse to ~eliasnaur/gio

A implementation for OSX is available in my gio repo:

https://git.sr.ht/~wrnr/gio/log

With an example of the gesture move:

https://git.sr.ht/~wrnr/gio/commit/57901d59fb6a1a394e9ab30b0790d4e17920532b

For some reason the rotate gesture doesn't work

Pinch Gesture API 9 months ago

From Werner Laurensse to ~eliasnaur/gio

Hi

What would the API for the pinch gesture look like?

From looking at the native OSX, iOS and Android APIs
I think it can be implemented in much the same way the other
pointer events are handled.

This would mean adding a pointer.Type called pointer.Pinch
and add a Scale field to pointer.Event struct to track the scale factor.

The rotate gesture can be supported the same way with a pointer.Rotate.

Maybe, the one confusing thing about this is that these are gestures,

Shape Module 1 year, 6 months ago

From Werner Laurensse to ~eliasnaur/gio

Hello Everyone

I've found the time to put my shape api into a separate module.
It should be a high level api to draw simple shapes.

The calculations are still a bit off in some cases,
and I'm still learning how to do scaling and rotation.

Feel free to try.

https://github.com/wrnrlr/shape

Kind regards
Werner Laurensse

Re: Drawing primitives and op.ImageOp 1 year, 6 months ago

From Werner Laurensse to ~eliasnaur/gio

FYI, I've been working on a simple vector drawing module as part of my
foxtrot project.
It's still a work in progress and currently only supports drawing lines.
When it is done, and I am happy with the API, I can prepare a path to
add it to gio if you like.
Current situation is here:
https://github.com/wrnrlr/foxtrot/blob/master/test/draw/main.go


On Mon, Jan 6, 2020 at 12:47 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Mon Jan 6, 2020 at 12:13 PM, András Belicza wrote:
> >
> > I know gio doesn't support drawing primitives such as lines, curves,