xaml-math
xaml-math copied to clipboard
Extract WPF-dependent code into a separate project
As part of #18 and #17.
Yep. An abstract rendering API might take a bit more thought than simply refactoring, but I am all for this!
I thought we could use visitor pattern to abstract this. We already have very similar code in Draw
and RenderGrometry
methods; that could be a basis for that refactoring. After extracting these to separate visitors, we could probably just split WPF part and the parser.
The parser still use some WPF features (I think fonts), so we should abstract those, also.
OK, this is next huge step after #93 got merged.
We'll definitely need to discuss that. Now I have a bit of insight on how our code works, so I could probably provide a useful advice.
@ForNeVeR, hello!
Do you update the 17-avalonia branch yourself? Or can I make edits to this thread without updates?
P.S. I have no goals yet. I'm just eyeing :)
I would accept a pull request to that branch.
Can we replace bg / fg Brush
with RgbaColor
(maybe also new struct with color and opacity) and only create a Brush
when rendering?
https://github.com/ForNeVeR/wpf-math/search?p=1&q=brush&unscoped_q=brush
Yeah, this seems like a right course of action. We'll lose some flexibility though (e.g. it won't be possible to create a texture background and such).
Could you think of a better solution, which will preserve ability to pass arbitrary Brush
(or whatever is Avalonia equivalent called) as a fore/background for our atoms?
Yes, I'm not talking about defining texture backgrounds from LaTeX code. I'm talking about providing an externally-defined Brush
for background/foreground, which may actually be useful.
Closed by #327.
There are now some basic abstractions for:
- colors,
- brushes,
- fonts,
- geometry.
Some of those were taken from the Avalonia branch, and ultimately everything is done with it in mind.
This has unlocked us from further work on #17.