-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Drawing.Color #141
System.Drawing.Color #141
Conversation
@Happypig375 What is the purpose of the NoEnhancedColors setting? If NoEnhancedColors is true, you cannot use |
It's not standard LaTeX. We should follow wpf-math's \color here. |
I don't like the name |
Yes I agree ColoredAtom is too long. As I was editing I could see there is something similar to RequireQualifiedAccess on these so there is duplication in the longer name. I think Atoms.Colored is better than Atoms.Color. |
|
Also note that I'm currently refactoring LaTeXParser, see the ParserRefactor branch. So please refrain from large changes across LaTeXParser. |
gives There is a problem in the parser where a ToString() is done on a parsed color object somewhere, before re-parsing it. I believe I didn't add this problem, and that in master if you adjust .ToString on CSharpMath.Structures.Color it will stop rendering some LaTeX. Will check now. |
Any ideas where the unnecessary ToString -> reparse steps are happening @Happypig375 ? |
They happen in the BindableProperties in MathView. There is no easy way to fix this. |
OK it looks like it's using the .LaTeX on a text/math painter in XSharpMath.Xaml/Views.cs line 182. Maybe there is some 2-way binding there, when there should just be a one way binding from string. |
Setting |
Also the property name "Colour" was used just to avoid clashing with the type name "Color". Now that the type name has changed, the property name can change back to "Color" to stay consistent with other "Color"s. |
Tests are failing - this PR is still not ready for review. |
Tests pass |
Except for CSharpMath.Rendering.Tests. The tests involving errors fail because the strings have changed and so the error views change. I could not find how to regenerate the images. Actually this approach is not good because the output doesn't need to match the images for CSharpMath to be working correctly. As shown in the current failed tests. These tests are more tests of similarity to a previous version than tests of correctness. An example of an approach that would work is to generate images on two platforms and require approximate equality. I've commented out the error-test data to get the tests to pass. I didn't delete the data/files because they could be used in a valid consistency test as described above. |
Delete the reference images and re-run tests a few times until all tests pass.
Agreed. File size comparisons are not good because that is not how humans compare images. We need a way to compare image similarity. If there are any suggestions, please say.
Disagreed. These tests ensure that CSharpMath will not suddenly draw nothing. CSharpMath.Rendering.Tests test whether CSharpMath.Rendering and CSharpMath.SkiaSharp can output images correctly.
Disagreed. There are baseline images that are analogous to expected data of unit tests. You can view the test cases by viewing the baseline images in CSharpMath.Rendering.Tests.
Disagreed. An error in CSharpMath.Rendering will cause errors in all platforms in CSharpMath.Rendering.Tests. We need baseline images as a result.
That is analogous to commenting out unit tests. This is a bad practice.
You can modify the data in the same way that you would modify expected data of unit tests when the implementation changes. |
Reduce code by removing a Color structure that duplicates System.Drawing.Color. Presumably this predated netstandard.