These are chat archives for AvaloniaUI/Avalonia

24th
Jan 2016
Gutemberg Ribeiro
@galvesribeiro
Jan 24 2016 12:01
@kekekeks hi! good news... we are changing to a new device which has 128mb ram and hast linux framebuffer on it at /dev/fb :)
Nikita Tsukanov
@kekekeks
Jan 24 2016 12:50
wow
that should be actually capable of running perspex
I'd recommend you to wait until coreclr support through
it should have less memory footprint
It also has built-in native compilation support
Gutemberg Ribeiro
@galvesribeiro
Jan 24 2016 12:53
@kekekeks coreclr don't run on this device... coreclr only run on ARVMv7+ and those devices are ARMv6
Nikita Tsukanov
@kekekeks
Jan 24 2016 12:55
ouch
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:01
@grokys I wonder if we could validate dependecy hierarchy using some post-build task
Instead of having a bunch of assemblies
Steven Kirk
@grokys
Jan 24 2016 13:34
not sure - that would be nice... but i'm not sure how you'd do that?
would also be nice to somehow squash all the base classes, e.g. InputElement, Interactive etc into a single class
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:38
Well, we can scan for class locations and then inspect resulting assembly
Could be done in unit tests
Steven Kirk
@grokys
Jan 24 2016 13:40
it's definitely something to think about for when we near 1.0
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:40
Or when we'll be moving to project.json
Steven Kirk
@grokys
Jan 24 2016 13:40
maybe a roslyn analyser
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:43
BTW, thinking about project.json
I think I know how to get XP support without codebase modifications
Denis Zaporozhets
@QuantumDeveloper
Jan 24 2016 13:43
why do you need XP support? O_o
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:43
Basically we need to compile against dnx451 platform and implement missing stuff in some assembly
Then ILMerge
@QuantumDeveloper You'd be amazed at the number of people who still want that stuff
But the point is that if we only use stuff from CoreFX, then we can have XP support
Steven Kirk
@grokys
Jan 24 2016 13:45
that would be great
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:46
But we need to switch to project.json first
Steven Kirk
@grokys
Jan 24 2016 13:46
and for that I think we need this to be fixed: Reactive-Extensions/Rx.NET#148
Richard Bennett
@dealproc
Jan 24 2016 13:47
That's a difficult discussion... XP itself is EOL, but there are other flavors, like POSReady 2009 that is still supported by Microsoft until '19.
POSReady 2009 uses the XP kernel
Nikita Tsukanov
@kekekeks
Jan 24 2016 13:47
Reactive-Extensions/Rx.NET#151
It can be compiled against netstandard1.3
Oh, project.json even allows to compile against net40
So, no ILMerge, just some internal classes compiled only for net40
Steven Kirk
@grokys
Jan 24 2016 14:04
@wieslawsoltes scrolling should now work again
Steven Kirk
@grokys
Jan 24 2016 14:11
we should probably think about the name change soon too
should we just go with Avalonia, or do people want to do a vote etc?
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:16

@wieslawsoltes scrolling should now work again

@grokys Thanks, its fixed.

Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:22
blob
@grokys I have problem with ScrollViewer combined with ContentControl
<TabItem Header="Shape" Classes="property">
    <ScrollViewer>
        <ContentControl Content="{Binding Path=Project.CurrentContainer.CurrentShape, Mode=TwoWay}"/>
    </ScrollViewer>
</TabItem>
The scroll bounds seems off when used like this
Steven Kirk
@grokys
Jan 24 2016 14:24
ok, first of all, ScrollViewer is a ContentControl so you should be able to just do <ScrollViewer Content="{Binding Path=Project.CurrentContainer.CurrentShape, Mode=TwoWay}"/>
though a 2-way binding doesn't make much sense there as ContentControl will never change the content itself
that probably won't fix your problem however - try adding CanScrollHorizontally="false" to the ScrollViewer
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:26
Ok so this does not help, I get same result
<TabItem Header="Shape" Classes="property">
    <ScrollViewer Content="{Binding Path=Project.CurrentContainer.CurrentShape, Mode=TwoWay}"/>
</TabItem>
Steven Kirk
@grokys
Jan 24 2016 14:27
try adding CanScrollHorizontally="false" to the ScrollViewer
that is, if the problem is that you don't want horizontal scrollbars
i assume there's content below the Y textbox in your screenshot?
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:29
No I want scrollbar when content is to small
Steven Kirk
@grokys
Jan 24 2016 14:29
what do you mean by "when content is to small"?
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:29
The CanScrollHorizontally="false" does not help
Steven Kirk
@grokys
Jan 24 2016 14:30
ok, let me try running that app
Core2d/master?
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:31
yes
This is how to reproduce the issue
Steven Kirk
@grokys
Jan 24 2016 14:34
ok, interesting bug!
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:34
To compile you need add some new NuGet source https://github.com/Core2D/Core2D#nuget-package-sources
I see now than not only ContentControl is affected, but UserControl'a are too when they are palced inside ScrollViewer
Steven Kirk
@grokys
Jan 24 2016 14:38
i'm getting the error: Could not load type 'Core2D.Core2D.Recent' from assembly 'Core2D'
i assume there's one too many Core2Ds there
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:41
Please remove file Core2D\Core2D.Perspex\bin\Debug\Core2D.recent
Steven Kirk
@grokys
Jan 24 2016 14:41
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Dependencies.JsonSerializationBinder.BindToType(String assemblyName, String typeName) in D:\projects\Core2D\Dependencies\Serializer.Newtonsoft\JsonSerializationBinder.cs:line 36
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
that works, thanks
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 14:52
Przechwytywanie.PNG
Empty.PNG
@grokys The rectangle control should fit inside the ScrollViewer bounds
Steven Kirk
@grokys
Jan 24 2016 14:58
yeah... just trying to work out what's happening exactly
thing is, ScrollViewer gives its child Infinity as its bounds
as obviously the child can be as big as it likes, and ScrollViewer will scroll to display that size
ah... open RectangleControl.paml and remove the Design.Width="250" Design.Height="400" properties
it sizes itself like it does in the ScrollViewer - so i think the problem isn't the ScrollViewer
looks like the problem is actually UserControl
Nikita Tsukanov
@kekekeks
Jan 24 2016 15:08

@grokys

should we just go with Avalonia, or do people want to do a vote etc?

You should probably ask MS guys first

Avalon may be registered or something
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:08
yes seems like when no Width or Height is specified the UserControl uses some default size
Steven Kirk
@grokys
Jan 24 2016 15:08
avalon was a codename so doubt it's registered
i can ask the guy from the .net foundation though
Nikita Tsukanov
@kekekeks
Jan 24 2016 15:10
I like that Omni Presentation Foundation suggestion
It cleanly states what our framework is
So we probably should make some vote page with variants and their pro/contra
Steven Kirk
@grokys
Jan 24 2016 15:12
eww, nooo. windows presentation foundation is far too longwinded and not something to copy imo
Nikita Tsukanov
@kekekeks
Jan 24 2016 15:13
I still like that omni prefix
may be OmniUI
github org is free
Steven Kirk
@grokys
Jan 24 2016 15:15
it's ok, i still prefer avalonia though
just seems to have more character to me
Nikita Tsukanov
@kekekeks
Jan 24 2016 15:15
There was some project named OmniUI but it got renamed to OpenADM
https://github.com/Avalonia is taken unfortunately
May be we should go with some randomly generated name or recursive acronym (Wine Is Not an Emulator is a good example)
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:18
Steven Kirk
@grokys
Jan 24 2016 15:18
yeah, i had the avalonia org registered on github and avalonia.com asked for it - i let them have it and said we'd use avaloniaui or something
in return they said we can use the name as long as we don't try to trademark it in holland ;)
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:19
@grokys This is strange, when I use RectangleControl without DataContext set than bounds are ok, after I set DataContext than it breaks
Steven Kirk
@grokys
Jan 24 2016 15:19
strange indeed...
i'm trying to work out where that size comes from...
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:21
before.PNG
after.PNG
Steven Kirk
@grokys
Jan 24 2016 15:24
it's not happening in the sample app
well, it does get that size in the designer but not at runtime
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:28
maybe its related to my data model
@grokys Ok I think I have found the source of the issue
<UserControl x:Class="Core2D.Perspex.Controls.Shapes.RectangleControl"
             xmlns="https://github.com/perspex"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Core2D.Perspex;assembly=Core2D.Perspex"
             xmlns:converters="clr-namespace:Core2D.Perspex.Converters;assembly=Core2D.Perspex"
             xmlns:core="clr-namespace:Core2D;assembly=Core2D"
             Design.DataContext="{Static core:DesignerContext.Rectangle}">
    <TabControl Classes="default">
        <TabItem Header="Rectangle" Classes="property">
            <Grid RowDefinitions="Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,*">
                <TextBlock Text="Name" Classes="left" Grid.Row="0" Grid.Column="0"/>
                <TextBox Text="{Binding Path=Name, Mode=TwoWay}" Classes="left" Grid.Row="0" Grid.Column="1"/>
                <TextBlock Text="IsStroked" Classes="left" Grid.Row="1" Grid.Column="0"/>
                <CheckBox IsChecked="{Binding Path=IsStroked, Mode=TwoWay}" Classes="left" Grid.Row="1" Grid.Column="1"/>
                <TextBlock Text="IsFilled" Classes="left" Grid.Row="2" Grid.Column="0"/>
                <CheckBox IsChecked="{Binding Path=IsFilled, Mode=TwoWay}" Classes="left" Grid.Row="2" Grid.Column="1"/>
                <TextBlock Text="Text" Classes="left" Grid.Row="3" Grid.Column="0"/>
                <TextBox Text="{Binding Path=Text, Mode=TwoWay}" Classes="left" Grid.Row="3" Grid.Column="1"/>
                <!--<TabControl Classes="default" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2">
                    <TabItem Header="TopLeft" Classes="property">
                        <ContentControl Content="{Binding Path=TopLeft, Mode=TwoWay}"/>
                    </TabItem>
                    <TabItem Header="BottomRight" Classes="property">
                        <ContentControl Content="{Binding Path=BottomRight, Mode=TwoWay}"/>
                    </TabItem>
                </TabControl>-->
            </Grid>
        </TabItem>
    </TabControl>
</UserControl>
The commented out part causes the ScrollViewer issues
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:33
TabControl inside a TabControl TabItem
I thinks this is related to this Perspex/Perspex#396
Steven Kirk
@grokys
Jan 24 2016 15:36
ah, i'd not seen that PR
let me apply it and see if it fixes the problem
Nikita Tsukanov
@kekekeks
Jan 24 2016 15:40
Wow
Someone who actually understands how grid works
Worship that guy
Steven Kirk
@grokys
Jan 24 2016 15:43
yeah! it's definitely the correct fix
doesn't seem to fix your problem though @wieslawsoltes
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 15:58

doesn't seem to fix your problem though @wieslawsoltes

Yeah it does not fix

Looks like more complex issue
Seems to be related to deeply nested ContentControls
Steven Kirk
@grokys
Jan 24 2016 16:00
yeah - i'm trying to understand it, but like you said it seems complex
i've added DesiredSize as a readonly PP so it appears in the devtools
may help with debugging these layout issues
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 16:09

i've added DesiredSize as a readonly PP so it appears in the devtools

Yep its helpful

Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:41
Hi! What is the best way to render Path with self intersections? Direct2D render by the following way: https://habrastorage.org/files/9c4/87d/dba/9c487ddbad4140dbb2af1be5fd595682.png
Steven Kirk
@grokys
Jan 24 2016 16:42
you mean D2D is rendering it wrong?
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:42
Steven Kirk
@grokys
Jan 24 2016 16:42
or D2D is correct but cairo and skia are wrong?
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:43
I don't know. It dependent on fill algorithm.
Steven Kirk
@grokys
Jan 24 2016 16:44
@kekekeks would probably know more about this than me
what does WPF do?
Nikita Tsukanov
@kekekeks
Jan 24 2016 16:44
WPF excludes the center from fill
Because technically it's outside of the path
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:45
Ok. In my opinion Direct2D fill algorithm is more simple and standardized.
Is it possible to exclude fill in Cairo and Skia?
Nikita Tsukanov
@kekekeks
Jan 24 2016 16:45
No idea
Need to do some reading on this
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:47
Ok, I will explore this.
Nikita Tsukanov
@kekekeks
Jan 24 2016 16:47
We probably need to use kEvenOdd_FillType
Because WPF/Direct2D seem to use this approach
To tell if a point is inside the path you need to draw a line in arbitrary direction and count the number of path segments it intersects
If it's an even value, your point is inside the path
If it's an odd value, your point is outside
That's why the center of the star is excluded
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 16:50
WPF_EvenOdd.PNG
WPF_NonZero.PNG
This is in WPF FillRule EvenOdd and NonZero
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:53
@kekekeks yep, I know. I studied fill algorithms in high school :)
Try this one
We can implement fill rule support later
Ivan Kochurkin
@KvanTTT
Jan 24 2016 16:56
Now I'am working on Polygon and Polyline shapes support. And because of this such question occured.
Nikita Tsukanov
@kekekeks
Jan 24 2016 16:56
Cairo also uses that fill rule by default
Mkay, let's implement that fill rule thingy
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 17:05
@grokys I have narrowed down the minimal Xaml to reproduce the issue
<Window xmlns="https://github.com/perspex" Width="1324" Height="670">
    <Grid ColumnDefinitions="*,250">
        <ScrollViewer Grid.Column="1">
            <TabControl>
                <TabItem Header="Rectangle">
                    <TabControl>
                        <TabItem Header="TopLeft">
                            <StackPanel>
                                <CheckBox Content="Default"/>
                                <CheckBox Content="Visible"/>
                                <CheckBox Content="Printable"/>
                                <CheckBox Content="Locked"/>
                                <CheckBox Content="Connector"/>
                                <CheckBox Content="None"/>
                                <CheckBox Content="Standalone"/>
                                <CheckBox Content="Input"/>
                                <CheckBox Content="Output"/>
                            </StackPanel>
                        </TabItem>
                    </TabControl>
                </TabItem>
            </TabControl>
        </ScrollViewer>
    </Grid>
</Window>
Nikita Tsukanov
@kekekeks
Jan 24 2016 17:15
Argh, guys, we need a build server
It's a pain in the ass to build all that native stuff for 4 platforms
And we'll also need multiple desktop linux archs (i386, arm, arm64) and macos
Nikita Tsukanov
@kekekeks
Jan 24 2016 17:29
@grokys I don't see where FillRule can be set in Direct2D
But people still do it somehow
Nikita Tsukanov
@kekekeks
Jan 24 2016 17:35
@grokys It seems that in Direct2D fill mode should be set at the time of path creation
I. e. only in StreamGeometryImpl
Because path geometries are immutable and can only be populated once, it is an error to call Open on a path geometry more than once.
Note that the fill mode defaults to SharpDX.Direct2D1.FillMode.Alternate. To set the fill mode, call SetFillMode before the first call to BeginFigure. Failure to do so will put the geometry sink in an error state.
Oh, great
Nikita Tsukanov
@kekekeks
Jan 24 2016 17:50
@wieslawsoltes @KvanTTT Perspex/Perspex@415c9c6
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 18:31
Yes thanks for implementing this.
Tested and working.
Core2D.PNG
for reference here is PDF version
PDF.PNG
Wiesław Šoltés
@wieslawsoltes
Jan 24 2016 18:36
Perspex_Skia.PNG
and Perspex/SKIA
Ivan Kochurkin
@KvanTTT
Jan 24 2016 19:42
@kekekeks, cool!
Ivan Kochurkin
@KvanTTT
Jan 24 2016 22:32
But at default SKIA renders with center fill, unlike Direct2D and Cairo.
Nikita Tsukanov
@kekekeks
Jan 24 2016 22:34
That's strange
It should always pass true to that method by default
Please, check that true is passed to DrawGeometry
Ivan Kochurkin
@KvanTTT
Jan 24 2016 22:39
Ok
Maybe I not updated native libs
Is it possible to use NuGet or another service for native libs?
Nikita Tsukanov
@kekekeks
Jan 24 2016 22:40
May be github LFS, dunno
The point is that native libs sometimes get updated without ABI changes
So there is no point of creating a commit in the main repo
Ivan Kochurkin
@KvanTTT
Jan 24 2016 22:44
Yep, true is passed to DrawGeometry, but fill inside star still exists.
Nikita Tsukanov
@kekekeks
Jan 24 2016 22:53
update natives
Ivan Kochurkin
@KvanTTT
Jan 24 2016 23:04
It works. See new PR: Perspex/Perspex#398