These are chat archives for AvaloniaUI/Avalonia

16th
Dec 2018
Nikita Tsukanov
@kekekeks
Dec 16 2018 06:27
I have't touched invalidation logic for IRenderRoot
Just made DeferredRenderer to properly handle Paint event
I think DeferredRenderer never invalidates the window since it paints the window by itself
ahopper
@ahopper
Dec 16 2018 06:38
strange, it used to work, has the default renderer changed for windows recently? Any suggestions for a robust source of 'scene changed' signal for the mouse over stuff?
Nikita Tsukanov
@kekekeks
Dec 16 2018 07:56
Hittesting doesn't produce a new scene version anymore
That had caused visual artifacts
ahopper
@ahopper
Dec 16 2018 08:00
ok, what I'm looking for is something to say the scene has changed so pointerover is updated when the pointer has not moved.
Nikita Tsukanov
@kekekeks
Dec 16 2018 08:03
Do you need hit-testing?
Hit-testing for the new layout version won't be valid until the next UpdateScene call
UpdateScene call happens only after render thread consumes the previously built scene
i. e. even if Invalidate call was working, hit testing information won't be valid at that point
Hit testing for the new layout is available only after UpdateScene call which you shouldn't be triggering yourself
You can call UpdateScene, but it won't do anything if previous frame isn't yet consumed
So you need a way to subscribe to scene updates
ahopper
@ahopper
Dec 16 2018 09:44
@kekekeks yes, I think hit testing is unavoidable, unless mouse position is somehow considered in the arrange pass. Ideally access to a dirty rect would be good so hit testing is only needed if the area under the pointer has changed.
Nikita Tsukanov
@kekekeks
Dec 16 2018 09:47
Rebuilding scene by hittesting calls on demand has broken our rendering previously
Scene has to be consumed by the render thread
Before the next one is produced
Changes are lost otherwise
ahopper
@ahopper
Dec 16 2018 09:57
so will doing the hit testing in a subscription to scene update solve this?
Nikita Tsukanov
@kekekeks
Dec 16 2018 09:58
I think it should
There is a problem though
You changes to pointerovered element would only apply from the next frame
Not sure how WPF handles that
ahopper
@ahopper
Dec 16 2018 10:00
yes I realize that but I suspect it in unavoidable, could be positive feedback otherwise
Nikita Tsukanov
@kekekeks
Dec 16 2018 10:01
If we re-run layout and scene rebuild immediately after hittesting
We might enter an infinite loop
ahopper
@ahopper
Dec 16 2018 10:01
yep that is what I meant by positive feedback
Nikita Tsukanov
@kekekeks
Dec 16 2018 10:02
It's OK to have positive feedback as long as it happens on the next frame, I think
ahopper
@ahopper
Dec 16 2018 10:02
that was my thought
Nikita Tsukanov
@kekekeks
Dec 16 2018 10:02
Sure, it will consume resources, but at least the user will see something
In case of ImmediateRenderer we probably need to trigger pointerover check right after rendering the frame
Basically, we need NewHitTestState event or something
DeferredRenderer would trigger it right after UpdateScene finishes
ImmediateRenderer would trigger it after handing Paint call
ahopper
@ahopper
Dec 16 2018 10:07
:+1:
SunTai(三台)
@a44281071
Dec 16 2018 13:09
how to add resource files? No api example.
i find 'AvaloniaResource' in csproj. but how to add it in ide?
Nikita Tsukanov
@kekekeks
Dec 16 2018 13:15
Add <ItemGroup><AvaloniaResource Include="Assets/**.*" /></ItemGroup> somewhere in your project file
All files in Assets directory and subdirectories would be treated as resources
SunTai(三台)
@a44281071
Dec 16 2018 13:19
more documents? is scarce. I don't think it's a good thing.
Nikita Tsukanov
@kekekeks
Dec 16 2018 13:20
We are relying on MSBuild for this. Basically every AvaloniaResource item from MSBuild project file gets included as a resource
You can specify rules like
<AvaloniaResource Include="*.jpg" />
<AvaloniaResource Include="*.png" />
So every jpg and png file would be included
SunTai(三台)
@a44281071
Dec 16 2018 13:24
I feel too much incomprehensible in this project. it's not quick right.
SunTai(三台)
@a44281071
Dec 16 2018 13:33
i'm sorry, how to use the resource file? in project demo Source="/Assets/delicate-arch-896885_640.jpg" throw exception directory not found 'E:\Assets\'
Nikita Tsukanov
@kekekeks
Dec 16 2018 14:30
You are using an outdated version
That doesn't have support AvaloniaResource and relative resource uris
0.7 version from nuget.org only works with old resm scheme that consumes <EmbeddedResource> items
Either switch to nightly builds (https://github.com/AvaloniaUI/Avalonia/wiki/Using-nightly-build-feed) or use resm scheme
here is an example of resm usage
Benedikt Stebner
@Gillibald
Dec 16 2018 16:57
Is it possible to run some unit tests only on windows and skip them on other os? Linux doesn't have Emojis by default so some of my tests are failing.
Jeremy Koritzinsky
@jkoritzinsky
Dec 16 2018 19:24
Use the xunit.skippablefact package. If we aren’t already using it, you can add it.
Nikita Tsukanov
@kekekeks
Dec 16 2018 19:37
@Gillibald
Win32Fact
You might want to move this file
@Gillibald its better to ship the beeded font files with te test suite
So they will run everywhere
I think Google provides their emojy font from android for free
Jeremy Koritzinsky
@jkoritzinsky
Dec 16 2018 19:55
That works too
Benedikt Stebner
@Gillibald
Dec 16 2018 20:45
Embedding a font that has the glyphs would be the best. Will have a look at google's Emoji font.
Looks like the Noto font only works on Android and Linux hmm
Ahh looks like they have a non colored version that should work. Will give it a try.
Benedikt Stebner
@Gillibald
Dec 16 2018 20:51
They use Apache 2.0 that should work 👍