These are chat archives for AvaloniaUI/Avalonia

12th
Nov 2015
Steven Kirk
@grokys
Nov 12 2015 00:10
finally!
was really simple in the end but took a while to find!
hacklex
@hacklex
Nov 12 2015 00:11
...Could not find what exactly is wrong with our ArcTo, so far
time to finally get some sleep, I guess
Friedrich von Never
@ForNeVeR
Nov 12 2015 05:34
Hey, guys. Are you using Appveyor? Then why doesn't you set up auto builds for pull requests? It could save you a bit of time reviewing these.
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 07:11

@wieslawsoltes Would you provide us with Core2D project that illustrates arcs?

https://www.dropbox.com/s/2jn4e0c2gjodvj8/Arcs.project?dl=0

All mentions of ArcTo in a repo are of a very simple signature, different from one I added 0_o

this is place where I draw arcs for Core2D using Perspex :
https://github.com/Core2D/Core2D/blob/master/Dependencies/Renderer.Perspex/PerspexRenderer.cs#L679

Arthur
@arthrp
Nov 12 2015 07:46
Speaking about CI, do you plan to set up mono environment?
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 08:05

@hacklex

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(180, 150), false);
    sgc.ArcTo(new Point(240, 150), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(360, 150), false);
    sgc.ArcTo(new Point(300, 150), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(210, 210), false);
    sgc.ArcTo(new Point(210, 270), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(330, 270), false);
    sgc.ArcTo(new Point(330, 210), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(480, 270), false);
    sgc.ArcTo(new Point(585, 360), new Size(105, 90), 0.0, true, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(180, 330), false);
    sgc.ArcTo(new Point(210, 300), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(240, 300), false);
    sgc.ArcTo(new Point(270, 330), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(210, 390), false);
    sgc.ArcTo(new Point(180, 360), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

var sg = new StreamGeometry();
using (var sgc = sg.Open())
{
    sgc.BeginFigure(new Point(270, 360), false);
    sgc.ArcTo(new Point(240, 390), new Size(30, 30), 0.0, false, SweepDirection.Clockwise);
    sgc.EndFigure(false);
}

This is code to reproduce ArcTo issues.

Nikita Tsukanov
@kekekeks
Nov 12 2015 08:11
@ForNeVeR There are builds for PRs, you can see them in build history. They just don't show on github for some reason
@arthur-peka What do we need mono environment for?
Most of our code is PCL
And there almost no any platform-specific code
If something is broken on Mono it's more likely to be a bug in Mono
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 08:22
@hacklex See issue #320, I have added full code to reproduce issue
Steven Kirk
@grokys
Nov 12 2015 09:42
@kekekeks i think it would be nice to have a mono CI build just to diagnose build problems
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:45
Well, it won't build some projects at all
Perspex.Designer for example
Steven Kirk
@grokys
Nov 12 2015 09:45
yeah, we'd have to create a mono build configuration
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:46
Or xamarin projects
Steven Kirk
@grokys
Nov 12 2015 09:46
https://travis-ci.com/ looks promising
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:46
yep, I was planning to use it for our skia builds
But currently it's easier to build things manually
Steven Kirk
@grokys
Nov 12 2015 09:48
i have no idea why appveyor doesn't display for PRs
i suspect it may be something to do with the fact the repository was moved from grokys/Perspex to Perspex/Perspex
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:49
We probably need to configure github repo
Steven Kirk
@grokys
Nov 12 2015 09:51
i've wiped the integrations and re-set them up but nothing seemed to change
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:52
Well, it seems that we need to wait until new pr
Since PR status is updated using API
Steven Kirk
@grokys
Nov 12 2015 09:55
no, i mean i wiped them and re-added a few months ago
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:56
Where exactly have you added them?
Steven Kirk
@grokys
Nov 12 2015 09:57
i can't remember exactly tbh - i think i removed the webhooks from appveyor and re-added them
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:57
I only see a webhook for gitter
which doesn't work
Nikita Tsukanov
@kekekeks
Nov 12 2015 09:58
Well, this webhook asks appveyor to start a build
We need to provide appveyor with some access token
Nikita Tsukanov
@kekekeks
Nov 12 2015 10:05
Well, try to ask appveyor support
Whoops
It seems that we need to login to appveyor using org account
Nikita Tsukanov
@kekekeks
Nov 12 2015 10:13
Perspex/Perspex#316
Yay
It works now
I've reauthorized AppVeyor using my github account
Friedrich von Never
@ForNeVeR
Nov 12 2015 11:08
Nice!
Steven Kirk
@grokys
Nov 12 2015 12:07
thanks! what exactly did you have to do?
Nikita Tsukanov
@kekekeks
Nov 12 2015 12:08
Well, it seems that AppVeyor wasn't authorized to access perspex org
Steven Kirk
@grokys
Nov 12 2015 12:14
ah ok. yeah, i thought it must have been something to do with the change to the perspex org
hacklex
@hacklex
Nov 12 2015 14:06

This is code to reproduce ArcTo issues.

Thank you. Will investigate.

Darnell Williams
@Seeker1437
Nov 12 2015 15:23
Xamarin hasn't fully released their CI tools yet
but just rememebr soon Xamarin will have CI tools...
Weston
@ronnyek
Nov 12 2015 16:37
xamarin leaves a bad taste in my mouth
Darnell Williams
@Seeker1437
Nov 12 2015 16:41
Yeah I actually found the Xamarin beforeit became Xamarin?
I want to build it up and make it open source :(
Weston
@ronnyek
Nov 12 2015 16:42
I guess I cant complain, companies need to make money
José Manuel Nieto
@SuperJMN
Nov 12 2015 17:35
@ronnyek Xamarin will become WinForms when Perspex comes kicking asses
Darnell Williams
@Seeker1437
Nov 12 2015 17:38
hah yep :D
Nikita Tsukanov
@kekekeks
Nov 12 2015 17:47
Not xamarin
Xamarin.Forms
José Manuel Nieto
@SuperJMN
Nov 12 2015 17:52
🙂 yes! Thanks for the correction
Darnell Williams
@Seeker1437
Nov 12 2015 17:58
Yay time for fallout 4
madness returns
hacklex
@hacklex
Nov 12 2015 21:04
meanwhile on the orbit, somewhere near perihelion
Found a funny bug in GetAngle
Now checking each of the test cases from above
Brace yourselves. The fixing comet is coming.
Nikita Tsukanov
@kekekeks
Nov 12 2015 21:22
@wieslawsoltes
hacklex
@hacklex
Nov 12 2015 21:22
Yep, ArcTo looks fine now
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 21:50
Yep ArcTo is fixed! Thanks @hacklex
Skia.PNG
hacklex
@hacklex
Nov 12 2015 21:52
actually the problem was very simple, the procedure calculating the angle between two vectors was written wrong
For everyone: if you will ever need to calculate the angle between v1 and v2, use
Math.Atan2(v1.x*v2.y-v2.x*v1.y, v1.x*v2.x+v1.y*v2.y)
hacklex
@hacklex
Nov 12 2015 22:02
Also, w3c recommendations on Elliptical Arcs (document explaining arcs in SVG) are seemingly partially wrong, endpoint-to-center parametrization proposed there somehow fails. I was forced to use my own method, starting from step 4 o_0
Nikita Tsukanov
@kekekeks
Nov 12 2015 22:02
Well, nobody cares about the specs
That's why it's still unnoticed
Darnell Williams
@Seeker1437
Nov 12 2015 22:02
lol
hacklex
@hacklex
Nov 12 2015 22:03
by the way, either
(a) YES
(b) I just failed to understand their instructions
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 22:05
Arcs are hard
Darnell Williams
@Seeker1437
Nov 12 2015 22:12
;)
hacklex
@hacklex
Nov 12 2015 22:13
Arcs are O(n³)-hard, as long as cubic beziers are used
Darnell Williams
@Seeker1437
Nov 12 2015 22:13
you guys are scary XD
I wish I knew rendering :D
Nikita Tsukanov
@kekekeks
Nov 12 2015 22:13
That's not rendering
That's Math
which is far more scary
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 22:14
You can always draw arc using lines :smile:
Weston
@ronnyek
Nov 12 2015 22:20
I unlearned all my maths after hs/college, and then started to draw charts/graphs... lots of math tied up there
hacklex
@hacklex
Nov 12 2015 22:23

You can always draw arc using lines :smile:

Oh yes you can. But remember that guy we borrowed the EllipticalArc helper class from? Well, he can't, because his ellipses sometimes have A-to-B ratio of 1e+7, and comets usually refuse to follow a polyline path. Otherwise they are usually classified as protoss (hopefully not zerg) ships.

Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 22:24
Yeah that is far beyond me in outer space
Closed issues #320 and #272 :)
hacklex
@hacklex
Nov 12 2015 22:25
but now we can say "with perspex, you can visualize comet orbits. Near perihelion, too!"
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 22:29
I have problem with OpenFileDialog on Linux/Gtk
Core2D.UI.Perspex.Desktop.exe Error: 0 : Specified cast is not valid.
   at Perspex.Gtk.SystemDialogImpl.ShowFileDialogAsync (Perspex.Controls.FileDialog dialog, IWindowImpl parent) in <filename unknown>:line 0
   at Perspex.Controls.OpenFileDialog.ShowAsync (Perspex.Controls.Window window) in <filename unknown>:line 0
   at Core2D.UI.Perspex.Desktop.App+<OnOpen>c__async1.MoveNext () in /home/wiso/Projects/Core2D/Core2D.UI.Perspex.Desktop/App.paml.cs:line 441
the code
                    var dlg = new OpenFileDialog();
                    dlg.Filters.Add(new FileDialogFilter() { Name = "Project", Extensions = { "project" } });
                    dlg.Filters.Add(new FileDialogFilter() { Name = "All", Extensions = { "*" } });
                    var result = await dlg.ShowAsync(_mainWindow);
                    if (result != null)
                    {
                        var path = result.FirstOrDefault();
                        _context.Open(path);
                        _context.Editor.Invalidate();
                    }
same issue on Windows/Gtk
Exception thrown: 'System.InvalidCastException' in Perspex.Gtk.dll
Core2D.UI.Perspex.Desktop.vshost.exe Error: 0 : Nie można rzutować obiektu typu 'WindowDecorator' na typ 'Perspex.Gtk.WindowImpl'.
   w Perspex.Gtk.SystemDialogImpl.ShowFileDialogAsync(FileDialog dialog, IWindowImpl parent)
   w Perspex.Controls.OpenFileDialog.ShowAsync(Window window)
   w Core2D.UI.Perspex.Desktop.App.<OnOpen>d__17.MoveNext() w C:\DOWNLOADS\GitHub\Core2D\Core2D.UI.Perspex.Desktop\App.paml.cs:wiersz 441
This was working few days ago :(
Nikita Tsukanov
@kekekeks
Nov 12 2015 22:35
Does it work with Win32?
Wiesław Šoltés
@wieslawsoltes
Nov 12 2015 22:36
Yes.
And works when I remove _mainWindow parameter
looks like issue in Perspex.Gtk
Weston
@ronnyek
Nov 12 2015 22:38
so is the consensus that perspex is officially moved to skia? or jsut leave all the backends in place?
Nikita Tsukanov
@kekekeks
Nov 12 2015 22:43
We'll be using Skia for Android/iOS
And may be for MacOS
Not sure if we need to replace Direct2D/Cairo
BTW, Direct2D backend is leaking
But it's the only one that passes all tests