These are chat archives for AvaloniaUI/Avalonia

3rd
Nov 2015
Nikita Tsukanov
@kekekeks
Nov 03 2015 00:12
Meanwhile UWP was ported to .NET Micro Framework and Cortex-M microprocessors
I wonder if we can run perspex there...
danwalmsley
@danwalmsley
Nov 03 2015 10:30
@kekekeks if that is possible that would be incredible!
Steven Kirk
@grokys
Nov 03 2015 12:05
just been talking to david fowler on the coreclr channel and it looks like we can get TypeConverters on all platforms
David Fowler
@davidfowl
Nov 03 2015 12:05
@grokys you need to ask for it
:)
dont share that too broadly yet
but do ask for it on corefx
and see what they say
Steven Kirk
@grokys
Nov 03 2015 12:05
oh hai! yes, i will ask for it there
i'll ping you in the issue in case i get any of the details wrong
it would make stuff so much easier...
but don't worry, i won't hold you to it ;)
David Fowler
@davidfowl
Nov 03 2015 12:38
:D
Egor Bogatov
@EgorBo
Nov 03 2015 12:55
wow, cool!
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:04
@grokys
I'm looking at our visual brush implementation and it scares me
Steven Kirk
@grokys
Nov 03 2015 14:05
ha, why is that?
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:06
It seems to be copy/pasted from imagebrush
Steven Kirk
@grokys
Nov 03 2015 14:07
both of them share TileBrushImpl which has the common functionality
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:08
I think we can make it xplat by using RenderTargetBitmap
Steven Kirk
@grokys
Nov 03 2015 14:08
yeah, i think that might work
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:08
But I don't know where to start
Steven Kirk
@grokys
Nov 03 2015 14:11
hmm, not sure either
i'd have to try doing it before i knew how to do it
the interactions between the different properties on tiled brushes are a real headache
however, there are extensive render tests
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:14
Hm
Direct2D implementation looks neat
It's cairo one that's messy
Meh, disregard that
Still messy
Steven Kirk
@grokys
Nov 03 2015 14:29
What's messy about it?
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:30
Nevermind, it's just me complaining about code I don't understand
Steven Kirk
@grokys
Nov 03 2015 14:34
ha, i know that feeling well ;)
unfortunately i couldn't find an easier way of doing it. which isn't to say there isn't one of course, just that i couldn't find it
i only wrote the d2d version though
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:37
For now I'm extracting stuff to some xplat class
hacklex
@hacklex
Nov 03 2015 14:56
Hi again, everyone ^_^
Done drawing ellipse segments at random angles with random ellipse main axis angle, prototype works like this: http://sendvid.com/mwdlnkpc
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:56
Translation: WPF-like ArcTo API implementation based on bezier curves is coming
hacklex
@hacklex
Nov 03 2015 14:56
Actually, most ArcTo implementations are based on bezier curves
I just never studied ALL of them to say "all implementations"
Nikita Tsukanov
@kekekeks
Nov 03 2015 14:57
^this guy knows math, worship him
hacklex
@hacklex
Nov 03 2015 14:58
This one is based on the totally amazing article and code sample by L.Maisonobe (http://www.spaceroots.org/documents/ellipse/elliptical-arc.pdf)
Who, in fact, knows math seemingly way better than me, but I guess he already founded a religion or two, so worshipping would prove hard, I think.
Weston
@ronnyek
Nov 03 2015 14:59
I resepct any of that math
I was doing simple chart drawing a while back
and that was PROBABLY pushing my boundaries
hacklex
@hacklex
Nov 03 2015 15:00
Well, that guy was complaining about the method being not accurate enough when drawing orbits of comets near the perihelion
Weston
@ronnyek
Nov 03 2015 15:03
as far as general purpose stuff goes... is perspex close at all to wpf's performance
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:03
Perspex isn't optimized at all
We haven't done any work on that front
Weston
@ronnyek
Nov 03 2015 15:04
doesnt mean you guys havent just started off better
I dont expect it to be 1:1
I was just curious what performance looks liek
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:05
It's leaking memory
Weston
@ronnyek
Nov 03 2015 15:05
yeah but thats only gonna really slow it down past a certain point, right?
Steven Kirk
@grokys
Nov 03 2015 15:08
hi @hacklex !
hacklex
@hacklex
Nov 03 2015 15:09
yep, hi
Steven Kirk
@grokys
Nov 03 2015 15:09
@ronnyek i did some tests at the beginning, testing the speed of PerspexProperty vs DependencyProperty and they seemed to be able equal for setting and much faster for bindings
though i'm sure that has changed
but as @kekekeks says - it's not really usable at the moment due to massive memory leaks
i need to investigate them, but first i want to get stuff working in general, because leaks aren't important if you can't actually do what you need to do!
Weston
@ronnyek
Nov 03 2015 15:10
understood
you guys profiled it yet?
also bitchin to hear about the binding stuff
Steven Kirk
@grokys
Nov 03 2015 15:11
kinda in passing, not really looked into it deeply
i know we have serious perf problems in our layout algorithm
but due to the fact it's exactly the same as WPF i have faith that it's fixable
Weston
@ronnyek
Nov 03 2015 15:12
yeah
I'm just extemely hopeful because this seems like this is going to be a huge improvement over what I can do on the linux side of things
especially if @kekekeks figures out the skia stuff
Steven Kirk
@grokys
Nov 03 2015 15:12
yeah, hopefully!
Weston
@ronnyek
Nov 03 2015 15:12
I can run skia shit directly on fb or drm driver
then I can kick android's bionic to the curb
Steven Kirk
@grokys
Nov 03 2015 15:13
so you're wanting it for android dev on linux?
Weston
@ronnyek
Nov 03 2015 15:13
no
I maintain ports of android for specific hardware
ported it, maintain the ports
but android basically blows
Steven Kirk
@grokys
Nov 03 2015 15:14
what specific hardware?
Weston
@ronnyek
Nov 03 2015 15:14
I like that I can take the kernel+android drivers+ drm drivers and rip out all the java and java interop crap
omap4460 and some exynos stuff
Steven Kirk
@grokys
Nov 03 2015 15:14
ha, ok. never heard of 'em ;)
hacklex
@hacklex
Nov 03 2015 15:14
Right now I am tidying and wrapping the code around arc the helper class, but it already looks fine. It even allows selecting the approximating curve order (polyline, quad or cubic) and (for some strange reason) piechart mode.
So, if anyone would ever want an elliptical piechart rotated by a random angle (wat?), this method will suffice.
Weston
@ronnyek
Nov 03 2015 15:14
exynos is embedded soc's from samsung
omap is ti
closest thing to omap is pandaboard of years ago
exynos board is similar to galaxy s5?
in any case
Steven Kirk
@grokys
Nov 03 2015 15:15
@hacklex so do you think the API we have makes sense? @kekekeks said that it seems to be a MS-specific way of doing a drawing API
Weston
@ronnyek
Nov 03 2015 15:16
if you could say anything that coudl run android could run .net with a nice little ui (perspex) that runs on directfb or even if that was achieved with the requirement of wayland/weston
that would be huge
Steven Kirk
@grokys
Nov 03 2015 15:16
yeah, i imagine!
hacklex
@hacklex
Nov 03 2015 15:16
Ehm
Weston
@ronnyek
Nov 03 2015 15:16
android is very very much targetting phones, and when you arent buildign phones... its bad
because everything is a hack =)
hacklex
@hacklex
Nov 03 2015 15:16
actually, it does make sense
To draw an arc, we specify the ellipse, the start angle and the end angle
Steven Kirk
@grokys
Nov 03 2015 15:17
because i'm fine with changing the API if it doesn't
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:17
It makes sense, but currently such api is implemented only in MS products
Everyone else uses much more simplified arcTo
hacklex
@hacklex
Nov 03 2015 15:18
the ellipse is specified by a centre point, two radii and a rotation (theta)
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:18
@hacklex found a way to implement it using bezier curves
And bezier curves are supported everywhere
hacklex
@hacklex
Nov 03 2015 15:18
actually, the way was found way before me
In this class, that math monster Luc Maisonobe even provided a selector for linear, quad and cubic approximations
Steven Kirk
@grokys
Nov 03 2015 15:20
it's good to have someone who knows maths onboard! i suck at maths!
hacklex
@hacklex
Nov 03 2015 15:21
I merely found him and his work, translated it into C# (thankfully his own example was in Java, so not much changes were required), and adapted it for use with WPF
wow, just visited his homepage
oh
Runge-Kutta solvers too, apparently
Wonder what exactly does he work on
if he came up with a dif-eq solver of his own 0_o
Actually, his approach is quite professional. He even properly estimates errors (deviation from ideal ellipse) and works around cases of ellipses with extreme parameters (such as 1000x2 ones)
and we automagically inherit such accuracy
hacklex
@hacklex
Nov 03 2015 15:26
In the video I posted above, the ellipse with thick border is drawn using standard WPF method. We can see that our own (thin red line) fits just perfectly.
Steven Kirk
@grokys
Nov 03 2015 15:29
haha
i have no idea what you're talking about, but it sounds impressive ;)
Weston
@ronnyek
Nov 03 2015 15:29
I read some article on how to take a million datapoints and be able to throw out like 3/4 of them and draw a chart that really loses no detail... some math formulas (obviously works differently at different resolutions)
it was mind blowing
hacklex
@hacklex
Nov 03 2015 15:30
As for inaccessibility of Quadratic Bezier curves on some platforms, we may easily work around this issue, because an (s, c, e) quad can be represented by the (s, (s+2c)/3, (e+2c)/3, e) cubic.
Steven Kirk
@grokys
Nov 03 2015 15:34
ok! (no idea) ;)
i really should try to learn maths, it's my biggest weakness as a programmer
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:47
New R# licensing model sucks
After switching to their subsription I can't even activate it
damn thing wont login to jb account
Steven Kirk
@grokys
Nov 03 2015 15:49
i still haven't heard back from them about the OSS licence
Nikita Tsukanov
@kekekeks
Nov 03 2015 15:49
They are too busy with moving to subscription model (
Nikita Tsukanov
@kekekeks
Nov 03 2015 16:28
@grokys https://github.com/Perspex/Perspex/blob/master/src/Windows/Perspex.Direct2D1/Media/TileBrushImpl.cs this is our new platform-specific code for image/visual brushes
Steven Kirk
@grokys
Nov 03 2015 16:31
oh yeah, that's a lot nicer. all tests passing?
Nikita Tsukanov
@kekekeks
Nov 03 2015 16:31
Yep
At least on my machine
Now I need to transfer these changes to cairo backend
Nikita Tsukanov
@kekekeks
Nov 03 2015 16:37
Yeah, choosing skia was the right decision. Implementing all that stuff with coregraphics/android.graphics would be nightmarish
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 17:29

As for inaccessibility of Quadratic Bezier curves on some platforms, we may easily work around this issue, because an (s, c, e) quad can be represented by the (s, (s+2c)/3, (e+2c)/3, e) cubic.

I am doing qbeziers with perspex like this: https://github.com/Core2D/Core2D/blob/master/Dependencies/Renderer.Perspex/PerspexRenderer.cs#L762

Using bezier curves.
Nikita Tsukanov
@kekekeks
Nov 03 2015 17:30
Direct2D and Skia support qbeziers natively
it's cairo that lacks support
Steven Kirk
@grokys
Nov 03 2015 17:39
hmm, i think i'm going to add name scope support at the Visual level
it doesn't really feel like the correct place to do it, but it makes the most sense because we're already traversing the tree at that point to find the root of the tree for OnAttachedToVisualTree
(i've decided not to do it like in WPF and rely on the XAML lib to handle name registration as you can create templates etc in code and potentially other markups)
anyone have objections?
Nikita Tsukanov
@kekekeks
Nov 03 2015 17:44
Name scopes seem to be a good idea
Also, with current system visual can properly unregister itself
WPF' way of doing this causes memory leaks
Steven Kirk
@grokys
Nov 03 2015 17:52
yeah, name scopes are needed - the current method of traversing the tree is just really inefficient
thing is, i ideally wouldn't do it at the Visual level - but - doing it there we can get registration for free
hacklex
@hacklex
Nov 03 2015 18:00
Oh wow, guys.
The class doing arcs is almost done, and I somewhat get what was the problem the math guru who written the original article was solving
Usual approach used in common graphics libraries to draw an arc can seemingly be explained with words "we take a few points on our ellipse, we draw a curve through them, and we suppose that if we took enough points (enough is, say, ten, or hundred), we can't tell our arc from an ideal ellipse segment"
This guy apparently encountered a problem with extremely wide ellipses (e.g. comet orbits), when the ellipse width/height ratio approached astronomical (no joke!) values of around 1e+8, or so
So he went deeper. And deeper. Seven times, as the order of magnitude of the above ratio suggests
hacklex
@hacklex
Nov 03 2015 18:06
In the end, he came up with good error estimations and error correction tables
When I encountered a comment, "default flatness for Bezier curve approximation (must be greater than 1e-10)"
I finally understood that this class is not just "good for drawing arcs". Using a microscope in art does not hold a candle to using comet orbit calculation software in cross-platform UI rendering.
But this class does its job perfectly fine, so we could use it well, merely redefining the notion of "overkill" as a side effect.
Nikita Tsukanov
@kekekeks
Nov 03 2015 18:13
So, we can replace Direct2D's ArcTo with this implementation, right?
hacklex
@hacklex
Nov 03 2015 18:14
No, we can't, and we shouldn't. These guys were aiming for extreme speeds, so we're to expect a notable performance difference.
Nikita Tsukanov
@kekekeks
Nov 03 2015 18:14
Geometry isn't supposed to be created every frame
And this implementation doesn't create tons of bezier curves
So it should be fine
hacklex
@hacklex
Nov 03 2015 18:15
But should the problem arise on our future space guidance computer... nope, it shouldn't.
Nikita Tsukanov
@kekekeks
Nov 03 2015 18:26
Argh
Skia doesn't have support for two-point radial gradients
Well, neiher does android
So this part of our API isn't xplat anyway
Steven Kirk
@grokys
Nov 03 2015 19:05
i can't imagine that being a huge problem
Nikita Tsukanov
@kekekeks
Nov 03 2015 19:28
blob
Eye_of_Skia.png
Steven Kirk
@grokys
Nov 03 2015 19:36
haha nice
Nikita Tsukanov
@kekekeks
Nov 03 2015 19:40
I think we need some complex animated geometry in our demo app
Especially when we'll get mobile support up and running
Because that's what Xamarin.Forms lacks - xplat drawing
Steven Kirk
@grokys
Nov 03 2015 19:45
yep, an animation showcase would be nice
Nikita Tsukanov
@kekekeks
Nov 03 2015 19:58
blob
Gradients FTW
todo:
  • text rendering
  • opacity
  • bitmap/visual brush
  • pen styles
Egor Bogatov
@EgorBo
Nov 03 2015 20:18
looks like an evil eye :)
Johan Larsson
@JohanLarsson
Nov 03 2015 20:42
cam it do neon lines?
Nikita Tsukanov
@kekekeks
Nov 03 2015 21:40
blob
BTW, I'm at the point where I'm manipulating some C++ structures from C# using pointers
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:07
@grokys why FormattedText is IDisposable while everything else isn't?
Steven Kirk
@grokys
Nov 03 2015 22:08
because in e.g. TextPresenter, when the text changes it disposes the old FormattedText
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:08
Mkay
Egor Bogatov
@EgorBo
Nov 03 2015 22:09
@kekekeks is there any chance to take a look how you do it?
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:09
Not yet
It will be split into 2 repos
Native part goes in it's own repo, managed will be in the main repo
For now it's a single solution
I can upload it somewhere
Egor Bogatov
@EgorBo
Nov 03 2015 22:11
oh, I am just curious how you implement the renderer :) I am currently fighting with SDL, and I am losing :(
Egor Bogatov
@EgorBo
Nov 03 2015 22:15
wow, interesting
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:15
BTW skia can use SDL
Egor Bogatov
@EgorBo
Nov 03 2015 22:17
UnmanagedFunctionPointer -- those things will require an additionall attribute for methods that will be used for those delegates -- MonoPInvokeCallback
on iOS only
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:17
Are you talking about Marshal.GetDelegateForFunctionPointer?
Currently C++ part doesn't perform any callbacks to managed code
Egor Bogatov
@EgorBo
Nov 03 2015 22:20
um.. so why do you need those delegates with UnmanagedFunctionPointer ? :)
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:21
Where?
It's a bridge to native exports
I'd rather limit DllImported stuff to one method
That will simplify native library discovery code
That will only need LoadLibrary/dlopen/GetProcAddress/dlsym
Egor Bogatov
@EgorBo
Nov 03 2015 22:24
I was just saying that I used native to managed callbacks a lot via UnmanagedFunctionPointer and everything was in PCL and it worked fine on windows, android, macos. But it didn't on iOS :'(
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:25
Yep, that's because runtime need to create RCW
To export managed delegate as a native pointer
Egor Bogatov
@EgorBo
Nov 03 2015 22:25
I would be happy if those attributes would be available in PCL :(
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:25
If you are doing the opposite it should be fine
Well, you might contact toolchain devs so they will allow you to create your own internal attribute with the same name
That's how C# compiler works
Egor Bogatov
@EgorBo
Nov 03 2015 22:28
thats how a friend of mine says when I ask him such questions: "fork Roslyn!"
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:28
So, what was your problem with SDL?
Egor Bogatov
@EgorBo
Nov 03 2015 22:30
1) it doesn't support tvOS 2) it's not suppossed to be used as UIView that you can easily integrate anywhere in your layout -- it requires some dirty hacks
btw, Perspex to tvOS FTW! :D
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:33
I am trying to get VisualBrush tiling to work, but I get only one tile, the rest is just black rectangle:
<VisualBrush TileMode="Tile" Stretch="None" AlignmentX="Left" AlignmentY="Top">
    <VisualBrush.Visual>
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical">
                <Rectangle Width="10" Height="10" Fill="DarkGray"/>
                <Rectangle Width="10" Height="10" Fill="LightGray"/>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <Rectangle Width="10" Height="10" Fill="LightGray"/>
                <Rectangle Width="10" Height="10" Fill="DarkGray"/>
            </StackPanel>
        </StackPanel>
    </VisualBrush.Visual>
</VisualBrush>
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:33
You need to specify tiling mode or something like that
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:33
Przechwytywanie.PNG
I have set TileMode="Tile"
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:34
Hm
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:34
Same issues in Gtk
Steven Kirk
@grokys
Nov 03 2015 22:34
@wieslawsoltes i think you need to specify the target rectangle
try doing the same in WPF
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:35
I get exception when I set DestinationRect
Steven Kirk
@grokys
Nov 03 2015 22:35
oh.. what exception?
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:36
Exception thrown: 'System.ArgumentException' in Perspex.Base.dll
System.ArgumentException
Invalid value for Property 'DestinationRect': '0,0,200,20' (System.String)
In WPF I do not have to set rectangle:
    <DrawingBrush x:Key="CheckerBoard" Viewport="0,0,20,20" ViewportUnits="Absolute" Stretch="None" TileMode="Tile">
        <DrawingBrush.Drawing>
            <DrawingGroup>
                <GeometryDrawing Brush="{DynamicResource DarkSquareColor}">
                    <GeometryDrawing.Geometry>
                        <GeometryGroup>
                            <RectangleGeometry Rect="0,0,10,10"/>
                            <RectangleGeometry Rect="10,10,10,10"/>
                        </GeometryGroup>
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
                <GeometryDrawing Brush="{DynamicResource LightSquareColor}">
                    <GeometryDrawing.Geometry>
                        <GeometryGroup>
                            <RectangleGeometry Rect="10,0,10,10"/>
                            <RectangleGeometry Rect="0,10,10,10"/>
                        </GeometryGroup>
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
            </DrawingGroup>
        </DrawingBrush.Drawing>
    </DrawingBrush>
Steven Kirk
@grokys
Nov 03 2015 22:38
you're setting the Viewport which is equivalent to the DestinationRect
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:38
What is correct format in Xaml ?
public static readonly RelativeRect Fill = new RelativeRect(0, 0, 1, 1, RelativeUnit.Relative);
Its need to be RelativeRect
Steven Kirk
@grokys
Nov 03 2015 22:39
yeah there's no RelativeRect type converter yet
i really want to get the name scope stuff finished right now, but if you wanted to submit a PR for a typeconverter it's really easy
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:40
where I can start?
Steven Kirk
@grokys
Nov 03 2015 22:41
take a look at Perspex.Markup.Xaml\Converters\RelativePointTypeConverter.cs
that's the impl for RelativePoint
you need to make a version of that for RelativeRect, implement RelativeRect.Parse and register the type converter in the XAML PerspexWiringContext
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:42
I will check this out, will see what I can do
Steven Kirk
@grokys
Nov 03 2015 22:43
that would be great!
btw if you're wondering about the name change between Viewport -> DestinationRect, it's because i could never remember which is which from Viewport and Viewbox
and every other library seems to use the source and destination rect naming
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:46
Yeah I do not like Viewport, Viewbox either
Steven Kirk
@grokys
Nov 03 2015 22:47
also if you could add a couple of tests into Perspex.SceneGraph.UnitTests as well that would be great
there are already a few for RelativePoint
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:48
what string format I should use
X,Y,WIDTH,HEIGHT,RelativeUnit ?
RelativePoint is using %
Like 0,0,1,1,Relative and 0,0,1,1,Absolute ?
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:50
%? God, why
Steven Kirk
@grokys
Nov 03 2015 22:51
hmm
@kekekeks RelativePoint and RelativeRect can specify an absolute point/rect or a percentage point/rect
so for RelativePoint : "50,50" meaning 50px,50px and "50%,50%" meaning "the center of the container" makes sense to me
however, for RelativeRect it could get a bit unwieldy i guess
"0%,0%,50%,50%"
though i'd suggest to just go with it for now
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:54
ok
Steven Kirk
@grokys
Nov 03 2015 22:54
maybe allow "0" to be with or without the "%" as 0px and 0% are always equal
but if you do that, you'd need to do it in RelativePoint too...
or maybe just "0,0,50,50%"?
that's not entirely clear to me though, it looks like X is px and Y is %
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:56
"%0,0,50,50"
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:57
RelativeRect can only have one RelativeUnit so all or nothing
Nikita Tsukanov
@kekekeks
Nov 03 2015 22:57
"R0,0,0.5,0.5"
Something like that
Steven Kirk
@grokys
Nov 03 2015 22:57
yeah, it's all or nothing
i don't like the "R" prefix
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:57
same line for point
Steven Kirk
@grokys
Nov 03 2015 22:58
but the "%" might work
"same line for point"? what do you mean?
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 22:59
0,0,1,1,Relative, 0,0,1,1,Absolute, 0%,0%,1%,1%,Relative, 0%,0%,1%,1%,Absolute
Steven Kirk
@grokys
Nov 03 2015 22:59
why the "Relative" or "Absolute" postfix though?
just 0,0,1,1, 0%,0%,1%,1% is needed
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:00
You are right, not necessary to specify
Steven Kirk
@grokys
Nov 03 2015 23:01
i'd say just make it work like RelativePoint for now and we can talk about how to make it less verbose later
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:02
ok
Steven Kirk
@grokys
Nov 03 2015 23:03
even like that it's better than Viewport="0,0,20,20" ViewportUnits="Relative" IMO
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:08
agree
Nikita Tsukanov
@kekekeks
Nov 03 2015 23:08
0%,0%,1%,1% is confusing
It suggests that you can specify absolute and relative units in the same expression
hacklex
@hacklex
Nov 03 2015 23:11
Finally, managed to convert the Arc Segment in endpoint notation to Arc Segment in centre and angles notation
3 hours of smoking w3c specs for SVG, meditations over its 2 different implementations (both wrong in cases of theta!=0)
aaaand it is there, arc segments via ArcTo using wpf-compatible call signature
This message was deleted
Nikita Tsukanov
@kekekeks
Nov 03 2015 23:14
All that left is to apply that to our cairo backend
Steven Kirk
@grokys
Nov 03 2015 23:14
@kekekeks yeah, i agree
Nikita Tsukanov
@kekekeks
Nov 03 2015 23:14
See "RenderHelpers" project
Steven Kirk
@grokys
Nov 03 2015 23:15
solution to that might be to allow specifying absolute and relative units in the same expression...
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:19
Already implemented the RelativeRectTypeConverter
same way as RelativePoint is
Steven Kirk
@grokys
Nov 03 2015 23:25
cool! does it solve your problem?
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:29
I'm afraid not :(
Steven Kirk
@grokys
Nov 03 2015 23:29
oh :(
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:29
                  <Border Grid.Row="0" Grid.Column="0" Width="200" Height="200" Margin="10">
                      <Border.Background>
                          <VisualBrush TileMode="Tile" Stretch="None" AlignmentX="Left" AlignmentY="Top" SourceRect="0,0,20,20" DestinationRect="0,0,200,200">
                              <VisualBrush.Visual>
                                  <StackPanel Orientation="Horizontal">
                                      <StackPanel Orientation="Vertical">
                                          <Rectangle Width="10" Height="10" Fill="DarkGray"/>
                                          <Rectangle Width="10" Height="10" Fill="LightGray"/>
                                      </StackPanel>
                                      <StackPanel Orientation="Vertical">
                                          <Rectangle Width="10" Height="10" Fill="LightGray"/>
                                          <Rectangle Width="10" Height="10" Fill="DarkGray"/>
                                      </StackPanel>
                                  </StackPanel>
                              </VisualBrush.Visual>
                          </VisualBrush>
                      </Border.Background>
                  </Border>
Or maybe my syntax is wrong for SourceRect and/or DestinationRect
Steven Kirk
@grokys
Nov 03 2015 23:34
your destination rect is the entire parent border
so it's stretching the rect 0,0,20,20 to 0,0,200,200 which is saying "display a single tile"
make the destination rect 0,0,20,20
Wiesław Šoltés
@wieslawsoltes
Nov 03 2015 23:35
works!
Steven Kirk
@grokys
Nov 03 2015 23:38
:D